Dataq DI-159 User Manual page 31

Table of Contents

Advertisement

StickOS
This will cause the program to stop as soon as the specified expression becomes true, such as
when a variable or pin takes on an incorrect value.
To set the smart watchpoint mode, which dramatically reduces watchpoint overhead at a slight
delay of input pin sensitivity, use the command:
watchsmart (on|off)
To display the smart watchpoint mode, use the command:
watchsmart
At any time when a program is stopped, you can enter BASIC program statements at the com-
mand-line with no line number and they will be executed immediately; this is called "imme-
diate mode". This allows you to display the values of variables, with an immediate mode
statement like:
print expression
It also allows you to modify the value of variables, with an immediate mode statement like:
let variable = expression
Note that if an immediate mode statement references a pin variable, the live DI-159 PLC pin is
examined or manipulated, providing a very powerful debugging technique for the embedded
system itself!
Thanks to StickOS's transparent line-by-line compilation, you can also edit a stopped BASIC
program and then continue it, either from where you left off or from another program location!
When the techniques discussed above are insufficient for debugging, two additional techniques
exist -- single-stepping and tracing.
To set the single-step mode for the BASIC program, use the command:
step (on|off)
To display the single-step mode for the BASIC program, use the command:
step
While single-step mode is on, the program will stop execution after every statement, as if a stop
statement was inserted after every line.
31
DI-159 PLC Hardware Manual

Advertisement

Table of Contents
loading

Table of Contents