We installed a pressure differential switch as a part seating confirmation on our work holding chuck. This is wired to an input X 4.0 . From my CNC program i used M104. From the external interface function X4.0 -- Fin M104. with 1 sec . If the part seat properly my pressure switch is ON and the program will continue and finish the cycle. when the part did not seat properly meaning the pressure switch is OFF. My program line stop at M104 then feed goes to feed hold. The problem is if you press the reset button then pressing the cycle start the program will continue to the next line and finish the cycle. This end up of part being machine to the wrong position.
Can a macro variables assigned to an output or input?
By looking at the ladder, find out which G address is associated with X4.0
The attached table gives correspondence between X/Y addresses and system variables.
Source: https://www.amazon.com/dp/0071713328