I enclose a reduced version with only two modes of operation, automatic and MPG.
As in the AUTO mode the pulse engine of PoKeys57CNC is disabled, it is Mach3 which causes the 5kHz signal of the charge pump to be output from the pin 45. In this AUTO mode, if I close Mach3 the 5 kHz signal disappears.
The problem is that, if this Mach3 is closed, I select the MPG mode, the 5 kHz signal appears. What I need is to generate a signal that prevents me from selecting any other mode, other than AUTO, if and only if Mach3 is active.
How I am able to send a signal (a 1 for example) to PoKeys57CNC from Mach3 when I start it, the only thing I do not know is to be able to put that signal to 0 when I close Mach3. I think that if I am able to detect by code (macropump) that I pressed the button to close Mach3, I will be able to detect its shutdown and act accordingly within my code.
I hope you have understood me. I do not express myself very well in English.