I have been running a dual table 5 axis router now for a few years on Mach4. I have a macro that looks for an input signal from a PLC telling Mach if that table is ready to run. the problem I am dealing with is the macro is a simple loop, looking at the Mach input controlled by the PLC and looping if it isn't on. I need another way to get it out of the loop. I wanted to use the screen button "Cycle Stop" but can't figure out how to "see" when it is pressed. I built and coded the machine years ago, and am not a programmer, so sorry if this one is a simple solution. My logic skills are good, my scripting/syntax skills need work!
Here is the working script:
local Yready = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT5);
repeat
local ytable = mc.mcSignalGetState(Yready);
until ytable==1
here is what I want to add in red:
local Yready = mc.mcSignalGetHandle (inst, mc.ISIG_INPUT5);
local CycleStopScreen = not sure what goes here
repeat
local ytable = mc.mcSignalGetState(Yready);
local cyclestop = not sure what goes here
until ytable==1 or cyclestop==1
I am just not sure how to tag the screen button, or the function. I have tried a couple ways but it hasn't been working. Maybe I am approaching it all wrong as well.
I am sure I can add an output signal to the Cycle Stop function that I could then look at, but figure I have to be able to see that screen button being pushed since Mach recognizes it, so there must be something there to directly tag
Thanks in advance for any help.