1
Mach4 General Discussion / Re: Mcode Macro works in program but not MDI?
« on: April 08, 2020, 03:37:16 PM »
Sorry for late reply. Lots of fires to put out lately!
I wrote this code 4 years ago so I am rediscovering how it works now . I found out my code relies on mc.mcCntlIsInCycle(inst) = 1 to function properly. The PLC script operates a pneumatic axis that reciprocates. It uses a linear scale to determine when to change direction. The grinding wheel outfeeds when at the end of the stroke. I use mc.mcCntlIsInCycle(inst) to ensure outfeed can only happen when the cycle is running.
Running the M100 in MDI mode does not change mc.mcCntlIsInCycle(inst) to a value of 1. I changed the code to use OSIG_RUNNING_GCODE = 1 and it appears to be functioning properly again .
I wrote this code 4 years ago so I am rediscovering how it works now . I found out my code relies on mc.mcCntlIsInCycle(inst) = 1 to function properly. The PLC script operates a pneumatic axis that reciprocates. It uses a linear scale to determine when to change direction. The grinding wheel outfeeds when at the end of the stroke. I use mc.mcCntlIsInCycle(inst) to ensure outfeed can only happen when the cycle is running.
Running the M100 in MDI mode does not change mc.mcCntlIsInCycle(inst) to a value of 1. I changed the code to use OSIG_RUNNING_GCODE = 1 and it appears to be functioning properly again .