omron — Appendix A: Variable Context

Appendix A:Variable Context 2. "Task" is specified as a task number (0, 1, 2, etc.), and the portion ":program" is omitted (for example, "@1" is input). In this case, variables are treated as though they are referenced within the program on the top of the stack for the specified program task. (That is, the last program shown for that task by the STATUS command-for example, "STATUS 1".) 3. "Task:" is omitted and "program" is specified (for example, "@sample" is input). In this case, variables are treated as though they are referenced within the (most recent occurrence of the) specified program on the task stack that is determined as follows:

l If the program debugger is not in use, the stack for the main control task (task 0) is used. l If the program debugger is in use, the stack for the task being accessed by the debugger is used. 4. "Task:program" are both specified, where "task" is a task number (0, 1, 2, etc.), and "program" is a program name (for example, "@1:sample" is input). In this case the variables will be treated as though they are referenced within the (most recent occurrence of the) program on the stack for the specified program task. When a context is specified (or implied), all the variables referenced in the command will be considered as local or automatic in that program if applicable.

Any variable referenced in the command that is not found within that program will be considered a global variable. Because automatic variables and subroutine arguments exist only within a particular program instance and can vanish whenever that program exits, access to their values by monitor commands is limited by the following conditions: l The program must be on a program stack. That is, it must appear in a program list shown by the STATUS command. l The program task for the stack being referenced must not be active. This is to guarantee that the variable does not vanish while being accessed. Failure to meet these conditions results in the error message:

*Undefined value in this context* If automatic variables or subroutine arguments need to be accessed during debugging, the desired program task can be aborted, the variables accessed, and execution of the task resumed. Interpretation of Context Specification for Variables eV+Operating System Reference Guide, 2.x,18321-000 Rev A Page 198