omron — LOCAL program instruction

LOCAL program instruction LOCAL program instruction Syntax LOCAL type variable, ..., variable Function Declare permanent variables that are defined only within the current program. Usage Considerations Subroutines can be called simultaneously by multiple program tasks and recursively by a single task. Local and global variables can be corrupted if such calls occur inadvertently. Thus, the use of automatic variables in place of local variables is recommended. LOCAL statements must appear before any executable statement in the program. If a variable is listed in a LOCAL statement, any global variable with the same name cannot be accessed directly by that program.

The values of local variables are not saved (or restored) by the STORE (or LOAD) monitor command. Parameters type Optional parameter specifying the type of a variable. The acceptable types are: LOC Location variable (transformation or precision point) REAL Single-precision real variable DOUBLE Double-precision real variable See the description of the GLOBAL program instruction for details on the default type. variable Variable name (belt, precision point, real-value, string, or transformation). Each variable can be a simple variable or an array. Array variables must not have their indexes specified. If a type is specified, all variables must be of that type.

eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 330