omron — Examples

WATCH monitor command specified by "@task:program". The expression may not contain automatic variables or subroutine arguments. Details A watchpoint is a real-valued expression that is evaluated before each step of a user program is executed. Whenever the value of the expression changes, program execution pauses and a message is displayed on the system terminal in the format WATCHPOINT changed at (t) pgm, step s. Old value: o, New value: n The message indicates that task "t" was about to execute step "s" of the program "pgm" when the value of the watchpoint expression changed from "o" to "n". When program execution pauses due to a watchpoint, you can issue any monitor command you wish.

For example, you may want to use STATUS to determine the execution status, LISTR to display the values of variables, or a WATCH command to clear the watchpoint that caused the pause. Execution can be continued after a watchpoint using one of the following commands: PROCEED, RETRY, SSTEP, or XSTEP. When a watchpoint is set, its associated program task number is specified. This number identifies the task that checks the watchpoint value and that is paused if the value changes. Note, however, that this task will pause even if the watchpoint value is changed by some other task (in which case the message displayed is meaningless).

Therefore it is important to associate a watchpoint with the appropriate task. Watchpoints operate by evaluating the expression and comparing the new value to the previous value before executing each program instruction. This action is time-consuming and can significantly slow program execution. See the eV+ Language User's Guide for more information on debugging programs. Examples Clear the watchpoint for task 0 (by default). WATCH Clear the watchpoint for task 2. WATCH @2 Set a watchpoint for task 3 to monitor the variable "i", which is local to program "test". WATCH @3:test i Set a watchpoint for task 1 to monitor the expression "ct global).

If "ct" is currently less than 5, the task will pause whenever "ct" becomes greater than or equal to 5 (the value of "ct eV+Operating System Reference Guide, 2.x,18321-000 Rev A Page 189