Ok here is what I have, I am using an HMI interface which is working with the KRC4 and AB PLC to run on a injection molding machine.
I have been looking at ways to be able to deselect the Active KRC4 Program (cell). I need to be able to stop the robot from the HMI (which I am able to do) resume if needed (which I am able to do) but under some cases I need to be able to cancel the running program completely and then select a new one.
Since this is running in Auto External I have to cancel the Cell program which I am able to do when setting a key switch to Manual position, my problem is when I am starting the Cell program back up, it goes nuts. The Cell program activates and then deactivates over and over until I put it in T1 Mode.
Maybe I am using the CWRITE function wrong ?
Any help?
This code is in the SPS.sub
;FOLD USER PLC
IF NOT $IN[77] and ($MODE_OP==#EX) THEN ; $IN[77] is Key switch in Manual position
CWRITE($CMD,STAT,MODE,"RUN /R1/CELL()")
ENDIF
IF $IN[77]== TRUE and ($MODE_OP == #EX) then ; Forces to Clear active Program when Key Switch is in Manaul Position
CWRITE($CMD,STAT,MODE,"CANCEL 1")
ENDIF