stevenal
Electrical
- Aug 20, 2001
- 3,848
I'm attempting to delay program execution in a user logic program in an SEL RTAC. This is what I came up with:
VAR
Pause:TON;
END VAR
//Program Pause
Pause(IN:=TRUE, PT:=T#100MS); //start timer
WHILE NOT(Pause.Q) //loop until timer expires
DO; //nothing
END_WHILE
Pause(IN:=FALSE); //reset timer
The idea is to start a 100ms loop that will end and continue into further statements after the timer expires. Evidently the loop is endless, since the watchdog timer is expiring. Can anyone explain why, suggest a tweak, or suggest a tried and true delay?
Internet searches turn up routines with RETURN statements. I've nothing to return to here, since this is the only program. Thanks.
VAR
Pause:TON;
END VAR
//Program Pause
Pause(IN:=TRUE, PT:=T#100MS); //start timer
WHILE NOT(Pause.Q) //loop until timer expires
DO; //nothing
END_WHILE
Pause(IN:=FALSE); //reset timer
The idea is to start a 100ms loop that will end and continue into further statements after the timer expires. Evidently the loop is endless, since the watchdog timer is expiring. Can anyone explain why, suggest a tweak, or suggest a tried and true delay?
Internet searches turn up routines with RETURN statements. I've nothing to return to here, since this is the only program. Thanks.