EXECUTE program instruction NOTE: Each time an execution cycle is initiated, the execution parameters are reset to their default values. This includes motion speed, robot configuration, and servo modes. However, the robot currently selected is not changed. If step is specified, the program begins execution at that step for the first pass. Successive cycles always begin at the first executable step of the program. All the instruction parameters are evaluated in the context of the new task that is started. This can lead to unexpected results when the EXECUTE program instruction is used, and an attempt is made to pass a task-dependent value (for example, the TASK real-valued function).
In such a case, if you want the task-dependent value to reflect the invoking task, you must assign the task-dependent value to a variable and pass that variable. Examples Initiate execution (as task #0) of the program named assembly, with execution to continue indefinitely (that is, until execution is aborted, a HALT instruction is executed, or a run-time error occurs): EXECUTE 0 assembly, -1 Initiate execution, with program task #2, of the program named test. The parameter values 1 and 2 are passed to the program.
EXECUTE 2 test(1,2) The following program segment shows how an application program can be initiated from another application program (the ABORT and CYCLE.END program instructions are used to make sure the specified program task is not already active): ABORT 3 ;Abort any program already active CYCLE.END 3 ;Wait for execution to abort EXECUTE 3 new.program ;Start up the new program Related Keywords ABORT monitor command ABORT program instruction CALL program instruction CYCLE.END monitor command CYCLE.END program instruction EXECUTE monitor command KILL monitor command KILL program instruction eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 212