EXECUTE program instruction

EXECUTE program instruction

Syntax

EXECUTE /C task_num program(param_list), cycles, step

Function

Begin execution of a control program.

Usage Considerations

A program cannot already be active as the specified program task.

Parameters

/C Optional qualifier that conditionally attaches the selected robot. The qualifier has an effect only when starting the execution of task 0.
task_num Real value or expression specifying which program task is to be activated. (For more information on program tasks, see the section Executing Programs in the eV+ Language User’s Guide.)
program Name of the program to be executed.
param_list
Optional list of constants, variables, or expressions separated by commas, that must correspond in type and number to the arguments in the .PROGRAM statement for the program specified. If no arguments are required by the program, the list is blank, but the parentheses must be entered.

Program parameters may be omitted as desired, using commas to skip omitted parameters. No commas are required if parameters are omitted at the end of the list. Omitted parameters are passed to the called program as undefined and can be detected with the DEFINED real-valued function.

Automatic variables (and subroutine arguments) cannot be passed by reference in an EXECUTE instruction. They must be passed by value (see the description of CALL).

The parameters are evaluated in the context of the new task that is started (see below).

cycles Optional real value, variable, or expression (interpreted as an integer) that specifies the number of program execution cycles to be performed. If omitted, the cycle count is assumed to be 1. For unlimited cycles, specify any negative value. The maximum loop count value allowed is 32,767.
step Optional real value, variable, or expression (interpreted as an integer) that specifies the step at which program execution is to begin. If omitted, program execution begins at the first executable statement in the program (that is, after the initial blank and comment lines and all the AUTO and LOCAL instructions).

Details

This command initiates execution of the specified control program. The program is executed cycles times, starting at the specified program step.

After a program initiates execution of another program, the initiating program can use the STATUS and ERROR real-valued functions to monitor the status of the other program.

The optional /C qualifier has an effect only when starting execution of task 0. When /C is not specified, an EXECUTE instruction for task 0 fails if the robot cannot be attached; attachment requires that the robot be calibrated and that arm power be enabled (or that the DRY.RUN switch is enabled). When /C is specified, an execute instruction for task 0 attempts to attach the robot, but allows execution of task 0 to continue without any indication of error if the robot cannot be attached.

Certain default conditions are assumed whenever program execution is initiated. They are equivalent to the following program instructions:

CPON ALWAYS
DURATION 0 ALWAYS
FINE 100 ALWAYS
LOCK 0
MULTIPLE ALWAYS
NULL ALWAYS
OVERLAP ALWAYS
SPEED 100,100 ALWAYS
SELECT ROBOT = 1

Also, the robot configuration is saved for subsequent motions.

An execution cycle is terminated when a STOP instruction is executed, a RETURN instruction is executed in the top-level program, or the last defined step of the program is encountered. The value of cycles can range from -32,768 to 32,767. The program is executed one time if cycles is omitted or has the value 0 or 1. Any negative value for cycles causes the program to be executed continuously until a HALT instruction is executed, an error occurs, or you (or another program) aborts execution of the program.

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

PRIME monitor command

PROCEED monitor command

RETRY monitor command

SSTEP monitor command

STATUS monitor command

STATUS real-valued function

XSTEP monitorcommand


Copyright © 1994 - 2016. Omron Adept Technologies, Inc.

猜你喜欢

转载自blog.csdn.net/lmf666/article/details/90115253