vcStatement
vcStatement is the basic implementation for statements in a robot program and a process routine.
Hierarchy
Most statements can be manipulated directly as vcStatement type objects, while others have their own implementations that inherit vcStatement.
Scope
Statements are created and contained in a vcScope object. The scope of a statement can be manipulated to change the order in which statements are executed and nest statements to form conditional loops and paths in a routine.
Robot Motions
Positions for motion type statements are frames implemented as vcPositionFrame objects. New positions can created using methods in vcPositionStatement. A position can be referenced by more than one statement, thereby allowing statements to call set positions in a robot program.
For information on types of statements, go to Statement Constants.
Common Properties
The following properties are common to all statements.
| Name | Type | Access | Description |
| IsEnabled | Boolean | RW | Defines if the statement is activated or deactivated. |
| Name | String | RW | Defines the name of the statement. |
| ParentScope | vcScope | R | Gets the scope of the statement. |
| Properties | List of vcProperty | R | Gets a list of properties of the statement. |
| ParentRoutine | vcRoutine | R | Gets the routine of the statement. |
| Type | Enumeration | R | Gets the statement's type.
See Statement Constants for more information. |
Robot Statement Specific Properties
Assign Variable
An Assign Variable statement sets the value of a variable in a routine. The statement and variable must belong to the same routine in a robot program.
| Name | Type | Access | Description |
| TargetProperty | String | RW | Defines the name of variable to assign a value. |
| ValueExpression | String | RW | Defines an expression that when evaluated returns the value to assign TargetProperty. |
Break
A Break statement immediately ends the execution of a While statement. This statement has no other specific properties.
Call Sequence
A Call Sequence statement allows a routine to branch out and execute another subroutine in a robot program.
| Name | Type | Access | Description |
| Routine | vcRoutine | RW | Defines a subroutine in robot program called by the statement. |
Notes:
- In some cases, you may want to use a Return statement in a called subroutine in order to end that branch of execution and complete a Call Sequence statement.
Comment
A Comment statement is a non-executable statement in a robot program that is used to leave comments about the program.
| Name | Type | Access | Description |
| Comment | String | RW | Defines the text of the comment. |
Continue
A Continue statement is used to loop back the execution of a While statement to its beginning. This, of course, would skip over all other remaining statements in the scope and reevaluate the condition of the loop. This statement has no other specific properties.
Define Base
A Define Base statement changes the position of a base frame in robot during a simulation. When you reset a simulation, the base frame returns to its initial position.
| Name | Type | Access | Description |
| IPOMode | Enumeration | RW | Defines the interpolation mode of the frame and the external configuration of a referencing robot controller.
0 1 2 Interpolation constants can be used with this property. Note: A conflict can occur if a base-tool pair in a referencing robot have the same IPOMode property value or cannot be used with the robot's current configuration. |
| IsRelative | Boolean | RW | Defines if Position is based in base frame coordinate system or its parent coordinate system.
A True value uses base frame coordinate system, so frame will be moved relative to its location at the time of statement execution. A False value uses the parent coordinate system of base frame defined in Node, so frame will be moved to an absolute location. |
| Node | vcNode | RW | Defines the parent node of base frame. |
| Position | vcMatrix | RW | Defines the position matrix of referenced base frame. |
| Base | vcBaseFrame | RW | Defines the base frame in robot affected by the statement. |
Define Tool
A Define Tool statement changes the position of a tool frame in robot during a simulation. When you reset a simulation, the tool frame returns to its initial position.
| Name | Type | Access | Description |
| IPOMode | Enumeration | RW | Defines the interpolation mode of the frame and the external configuration of a referencing robot controller.
0 1 2 Interpolation constants can be used with this property. Note: A conflict can occur if a base-tool pair in a referencing robot have the same IPOMode property value or cannot be used with the robot's current configuration. |
| IsRelative | Boolean | RW | Defines if Position is based in tool frame coordinate system or its parent coordinate system.
A True value uses tool frame coordinate system, so frame will be moved relative to its location at the time of statement execution. A False value uses the parent coordinate system of tool frame defined in Node, so frame will be moved to an absolute location. |
| Node | vcNode | RW | Defines the parent node of tool frame. |
| Position | vcMatrix | RW | Defines the position matrix of referenced tool frame. |
| Tool | vcBaseFrame | RW | Defines the tool frame in robot affected by the statement. |
Delay
A Delay statement delays the execution of a robot program by a given amount of time.
| Name | Type | Access | Description |
| Delay | Real | RW | Defines the amount of time in seconds of the delay. |
Halt
A Halt statement can stop a simulation.
| Name | Type | Access | Description |
| HaltSimulation | Boolean | RW | Defines if the statement stops a simulation.
A True value stops a simulation, whereas a False value has no effect on a simulation. |
| ResetSimulation | Boolean | RW | Defines if the statement stops and then resets a simulation.
A True value resets a simulation, whereas a False value has no effect on a simulation. |
Print Message
A Print Message statement allows you to print feedback in the Output panel.
| Name | Type | Access | Description |
| Message | String | RW | Defines the text of the message. |
Program Synchronize
A Program Synchronize statement allows the execution of a robot program to be synced with programs in other robots.
| Name | Type | Access | Description |
| SyncComponents | List of vcComponent | RW | Defines a list of components to sync with the statement.
This means each component is also executing its own Program Synchronize statement. |
| SyncMessage | String | RW | Defines the message to trigger synchronization.
All components in SyncComponents must use the same message. |
| WaitSync | Boolean | RW | Defines if the statement sends its message and waits to receive the same message from all other components in SyncComponents.
A True value waits, whereas a False value sends a message and ends the execution of the statement. |
Return
A Return statement ends the execution of a routine. In most cases, you would use a Return statement to end the execution of a called subroutine in a robot program. This statement has no other specific properties.
Set Binary Output
A Set Binary Output statement sets the value of a signal mapped to an output port of a robot.
| Name | Type | Access | Description |
| OutputPort | Integer | RW | Defines the port of robot set by the statement. |
| OutputValue | Boolean | RW | Defines the value of the port set by the statement. |
Set Statistics
A Set Statistics statement sets the statistics behavior of a robot.
| Name | Type | Access | Description |
| Statistics | vcStatistics | RW | Defines the statistics behavior of robot referenced by the statement. |
| State | String | RW | Defines the current state of robot. When you create a new Set Statiscs statement, the initial state is NULL. You can also add custom states. |
Wait for Binary Input
A Wait for Binary Input statement delays the execution of a robot program until the value of a signal mapped to an input port in a robot has a specific value. The evaluation of the port can be cyclic or triggered by a signal event.
| Name | Type | Access | Description |
| InputPort | Integer | RW | Defines the port of robot evaluated by the statement. |
| InputValue | Boolean | RW | Defines if InputPort value needs to be True or False to complete the statement. |
| WaitTrigger | Boolean | RW | Defines if InputValue is evaluated when a signal mapped to InputPort has an event, for example a change in its value.
A True value waits for a signal event or trigger, whereas a False value will not wait to check the value of InputPort. Note: A signal event or trigger must occur while the robot is executing the statement, otherwise the robot wil miss the event. |
Set Next Flow Step Statement
Type constant: VC_STATEMENT_SETNEXTFLOWSTEP
| Name | Type | Access | Description |
| FlowInfoVariableName | String | RW | Name of the Process variable where to get the Product instances. |
| ProductVariableName | String | RW | Defines the selection of process groups that will be affected by this statement. |
| ForceExactFlowStep | Expression | RW | An editable list of explicitly accepted process groups. Used with SpecificProcesses mode. |
| ForceExactProcessGroup | Expression | RW | An expression which defines the number to assign as process visit count. |
| RetainVisitCount | Expression | RW | Defines how the result of VisitCount will be applied. |
Set Product Visit State Statement
A process statement that assigns (and resets) the state of how many times a product instance has visited some process.
Type constant: VC_STATEMENT_SETPRODUCTVISITSTATE
| Name | Type | Access | Description |
| ProductVariableName | String | RW | Name of the Process variable where to get the Product instances. |
| TargetProcessMode | Enumeration | RW | Defines the selection of process groups that will be affected by this statement. |
| Processes | List of vcProcessGroup | RW | An editable list of explicitly accepted process groups. Used with SpecificProcesses mode. |
| VisitCount | Expression | RW | An expression which defines the number to assign as process visit count. |
| VisitCountMode | Enumeration | RW | Defines how the result of VisitCount will be applied. |
Layout Item Specific Properties
View
A View statement is used with vcViewAnimation to set the view of the 3D world. Generally, this statement is used for animating camera movements during a simulation.
| Name | Type | Access | Description |
| Delay | RW | RW | Defines the amount of time in seconds it takes camera to move to view in 3D world. |
| View | String | RW | Defines the name of view to move camera to in 3D world.
If the view does not exist in layout, the statement will still execute its Delay. |
Methods
| Name | Return Type | Parameters | Description |
| createProperty | vcProperty | Enumeration type, String name | Creates a new property of a given type and name in the statement, and then returns the new property.
An optional constraints argument can be used to define constraints for new property, which must be defined at the time of creation. See Property Constants for more information. |
| deleteProperty | None | vcProperty property | Deletes a given property in the statement. |
| getProperty | vcProperty | String name | Returns a property matching a given name in the statement; otherwise returns None. |