How do I add the Manual NC command "Display Message" to my post processor config?

How do I add the Manual NC command "Display Message" to my post processor config?

johannesJGAKQ
Enthusiast Enthusiast
2,269 Views
3 Replies
Message 1 of 4

How do I add the Manual NC command "Display Message" to my post processor config?

johannesJGAKQ
Enthusiast
Enthusiast

I want to add support for the "Display Message" command in my post processor config file.

Screenshot 2021-12-17 at 00.29.37.png

My end goal is to output this message as a line of G-code like this:

 

(MSG, Message goes here)

 

 

I don't want to use the PassThrough command, since there is no validation of code there, I'd rather prefer to make use of the built in "Display Message" command, and only allow it to output text, similar to what the "Comment" function does.


I have tried adding this:

 

function onDisplay(message) {
writeDisplay(message);
}

 

but that didn't work. I cannot find any variables or functions named "message", so I am not sure how to make that show up.
 
(Stop/M0 works, and Comment works as well. Just not sure how I get the Display Message to work).
 
 
Any suggestions?
 

 

 

0 Likes
Accepted solutions (1)
2,270 Views
3 Replies
Replies (3)
Message 2 of 4

daniel_lyall
Mentor
Mentor

Depending on how you want it there are a few ways to add a message to a Gcode with its post using a straight out write message for a permanent message or doing a variable.  


Win10 pro | 16 GB ram | 4 GB graphics Quadro K2200 | Intel(R) 8Xeon(R) CPU E5-1620 v3 @ 3.50GHz 3.50 GHz

Daniel Lyall
The Big Boss
Mach3 User
My Websight, Daniels Wheelchair Customisations.
Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 4

johannesJGAKQ
Enthusiast
Enthusiast

The goal was to take advantage of the Manual NC command "Display Message", so that I could type whatever message I wanted, and have it be displayed on the CNC control.

After doing some tests, I actually need it to be prefixed with an M0 command as well.

 

So the output I'm looking to achieve is this:

M0 (MSG, My message goes here)

 

But with the ability to change the content of the message each time I use it.

 

Thus, I was hoping to figure out how to make the "Display Message" show up in my post.

 

Kind regards

Johannes

 

 

0 Likes
Message 4 of 4

johannesJGAKQ
Enthusiast
Enthusiast
Accepted solution

I found this post, which helped me get to the solution.

 

https://forums.autodesk.com/t5/hsm-post-processor-forum/improved-handling-of-manual-nc-commands/td-p...

 

 

// Process Manual NC Command Display Message

function onManualNC(command, value) {
  switch (command) {
  case COMMAND_DISPLAY_MESSAGE: // prepend ‘MSG,’ to operator messages
  writeBlock("M0 " + "(MSG, " + value + ")");
    break;
  default:
    expandManualNC(command, value);  // normal processing of Manual NC command
  }
}