vcExecutor

vcExecutor allows you to execute a robot or servo program.

Inherits: vcBehaviour

Properties

Name Type Access Description
Controller vcRobotController

or

vcServoController
RW Defines the controller associated with the executor.
CurrentStatement vcStatement R Gets the statement currently being executed by the executor.
DigitalInputSignals vcBooleanSignalMap RW Defines the input signal device associated with the executor.
DigitalOutputSignals vcBooleanSignalMap RW Defines the output signal device associated with the executor.
IsEnabled Boolean RW Defines if the program is executed during simulation.
IsLooping Boolean RW Defines if the executor loops its program.
ProcessHandlers List of vcPythonProcessHandler RW Defines a list of process handlers for overriding or modifying statements of robot program and executing process statements.

(Deprecated) Use StatementHandler.

Program vcProgram R Gets the program associated with the executor.
StatementHandler vcPythonProcessHandler RW Defines a process handler for controlling the execution of statements in robot program.

See an example of modifying a point-to-point motion statement.

Important: Process statements and Path statements with assigned process handlers are executed by their handlers. That is, those statements are not passed on to the statement handler of executor. Do not call nor try to execute them with the statement handler.

UseExternalExecutor Boolean RW Defines if the component is controlled by external execution mechanism, for example a virtual robot controller.

Methods

Name Return Type Parameters Description
callRoutine None vcRoutine routine, [Boolean suspendScript], [Boolean clearCallStack]

or

String name, [Boolean suspendScript], [Boolean clearCallStack]

Executes a routine.

By default, Python execution is suspended until the routine has been completed.

An optional suspendScript argument can be given a False value, thereby Python execution continues immediately.

An optional clearCallStack argument can be given a False value, thereby the call stack of executor is not cleared before executing routine.

callStatement

None

vcStatement statement, [Boolean suspendScript]

Executes a statement.

By default, Python execution is suspended until the statement has been completed.

An optional suspendScript argument can be given a False value, thereby Python execution continues immediately.

Note: You can use callStatement() with a process handler to modify the default execution of statements in robot program, for example point-to-point motions, as well as the pre/post execution of statements.

setOutput None Integer output_index, Boolean value Sets the value of a signal connected to a port at a given output_index in robot.
trySetDigitalInputSignals Boolean vcBooleanSignalMap signal_map Tries to set the given boolean signal map behavior as the digital input signals.

If setting the behavior is successful, returns True. Otherwise, returns False.
trySetDigitalOutputSignals Boolean vcBooleanSignalMap signal_map Tries to set the given boolean signal map behavior as the digital output signals.

If setting the behavior is successful, returns True. Otherwise, returns False.
waitInput None Integer input_index, Boolean value Schedules the executor to wait until a signal connected to a port at a given input_index in robot has a given value.

Note: Python execution continues immediately.

Events

Name Parameters Description
OnCurrentStatementChanged None Triggered when the current statement of executor changes to a different statement.   (Deprecated) Use OnPreExecuteStatement.
OnPostExecuteStatement vcStatement statement, bool isImmediate Triggered after execution of a statement.
OnPreExecuteStatement vcStatement statement, bool isImmediate Triggered before execution of a statement.   The isImmediate argument defines if the statement will be executed immediately (non time-consuming mode)
OnProgramFinished vcExecutor executor Triggered when the execution of program has finished.