Feeding warning/error messages back to Post users

Feeding warning/error messages back to Post users

gavin9537
Contributor Contributor
287 Views
2 Replies
Message 1 of 3

Feeding warning/error messages back to Post users

gavin9537
Contributor
Contributor

 

The PostProcessor Class Reference contains definitions for warning() and error() functions, which take messages as strings. Is it possible to use these to feed messages back to the Post user? I can't seem to get them to work - they seem to be ignored. Do I need to setExitCode()? If so, to what value to indicate errors and warnings?

 

Thanks

 

Gavin

0 Likes
Accepted solutions (1)
288 Views
2 Replies
Replies (2)
Message 2 of 3

xander.luciano
Alumni
Alumni
Accepted solution

Hey there!

Here's an example of how you would write each in code:

  // Output warning that axes take longest route
  if (retractDistance <= 0) {
      error(localize("Rotary axes are taking longest route without tool retraction."));
      return;
  } else {
      var text = localize("Tool is retracting due to rotary axes limits.");
      warning(text);
      writeComment(text);
  }


So you're correct in your assumption about them taking strings.

Is it possible to use these to feed messages back to the Post user?

Yes there is, technically. I'm just now sure if it's what you're looking for exactly. But basically if you use an error, then the code will not post, it will error out, and a log will pop up with the error message. That looks like this:

ANfTmM6


A warning however won't abort code generation, but it will display an error log file with the warning, but it will also save a complete gcode file. An error causes the code to abort, and you only end up with something like half of a file.

Here's a good example of that:

uHUJ3Ty

I'm assuming you wanted something a little more visually though for the users? Of which this is going to be the best option available unless you have enough free time to write additional software too.

Hope that helps clear things up a little bit for you, best
-Xander Luciano



Xander Luciano
CAM Content Developer

If my post is helpful, press the Kudo button - If it resolves your issue, press Accept as Solution!
Quick Tips: When to resselect CAM geometry | Understanding Smoothing in CAM | Adaptive Facing | Online GCode Viewer
0 Likes
Message 3 of 3

gavin9537
Contributor
Contributor

AH! I see. Thanks Xander - v helpful

 

0 Likes