PROGRAM 'Program 2 'TODO: edit your program here ' Run this as long as the main parser wants to while (BIT bDriveMotionProgram) ' Do nothing if the E-Stop isn't pressed while (BIT bEStopClear and BIT bProgZeroRunning and BIT bProgOneRunning) if (BIT bMaxPosErrExceeded and NOT BIT bKillAxisZero) set bKillAxisZero set bKillAllMovesZero endif wend ' Kill the axis and clear any move requests. 'Note: it will keep doing this every time, so even if something tries to 'clear thes flags, it will ensure a halt. set bDisableDriveOnKill set bKillAxisZero set bKillAllMovesZero if (BIT bAxisZeroJogActive) dwl 0.2 jog off axis0 endif if (BIT bEnableAxisZero) dwl 0.2 clr bEnableAxisZero endif clr bActuatorMove wend 'If we exit somehow, make sure the other programs also die. clr bDriveMotionProgram ENDP