I am making a mill turn post that turns live tooling on with M43 and off with M40. usually M40 is used right before the gohome move, but if the user doesn't have a gohome move then it has to outputted once somewhere else and only if M43 is active.
I would like know if I can create an m code for M40 to output if M43 was called in the operation. Much like with coolant or with the spindle . I can do it with custom commands, but I am hoping there is a simpler way to do this.
NX Post keeps track of modality for each word that is used in the postprocessor.
As already mentioned you can copy an existing word (M_spindle) or create a new one and use that.
When it is set to modal it will only be outputted when the value of the address is changed.
If you want to give the word an intial state you can can put it in its own block and use the following command to set the word to a modal value but not outputting it.
MOM_do_template blockname create
the keyword create allows you to capture the output as a return value but not outputting it to file.