Internet PLC Forum
General => Technical support => Topic started by: garysdickinson on December 18, 2011, 10:18:04 AM
-
I was attempting to work on the CRC issue raised on the forum, and find that I am very confused about the TBASIC PAUSE statement.
I am attempting to use PAUSE as a debug tool. I have the following custom function that is run on the first scan:
setlcd 1,1,"Program Started"
pause
setlcd 2,1,"Program Continued"
I expected to observe:
- "Program Started" message on the LCD
- "Pause Executed in Fn #1" window
- Click on PAUSE menu button to continue
- "Program Continued" message on the LCD
This is what I observed:
- "Program Started" message on the LCD
- "Pause Executed in Fn #1" window
- Click on PAUSE menu button to continue
- Simulation continues on next rung of ladder logic
PAUSE seems to be interpreted as a special version of the TBASIC "Return" statement.
Is this the design intent of PAUSE?
Gary d
-
PAUSE appears to work correctly as per your expectation on the PLC. But on the simulator it appears to quit the custom function after it has been released from PAUSE. I think it is a bug with the simulator which we will fix it in the next release of the software.
-
Thanks,
I was using the simulator to debug a crc routine and was a bit worried about how TBASIC would handle bit-wise operations and the rshift / lshift behavior.
Gary d