Hello,
I was thinking at this:
IF SWITCH(RUN)==TRUE AND SWITCH(ERROR)==FALSE AND SWITCH(TEACH_LOCK)==FALSE AND SWITCH(REPEAT)==TRUE AND SWITCH(STP_ONCE)==FALSE AND SIG(2025)==FALSE THEN
SIGNAL 2020
ELSE
SIGNAL -2020
END
Signal 2025 is output signal dedicated for the emergency button.
Signal 2020 is the status for the robot (ready or not for repeat mode).
I don't think there are many people that are checking for those conditions.