The first line has an issue, it is this: IF DOutput(doCycleOn) = 0
For that to be true then the program cannot be running, If the program is not running, then the code does not get executed. If you could put that in a background task then it might work.
Display More
If I write a program like this, and add it into WARNING MODULE like air presence control in MAIN proc, I think the system will stop after 15 minutes. say what?
IF nmtime{4}>=900 THEN
ClkStop mtime{4};
Why not just turn on an output, connected to motor off system input? Can be virtual.
ErrWrite mfundament{1}, mmy_message{1}\RL2:=my_message{3}\RL3:=my_message{5};
SystemStopAction\Halt;
ENDIF --- Remove this
ELSEIF diLS1PrgStart = 1 OR diLS2PrgStart = 1 OR diLS3PrgStart = 1 OR diLS4PrgStart = 1 OR diLS5PrgStart = 1 OR diLS6PrgStart = 1 THEN
ClkReset mtime{4};
nmtime{4}:=0;
MotorOffTime:=FALSE;
ENDIF