4.3.6 Assign

The [Assign] command allows you to create a new program variable. It assigns the selected variable with the value of the expression or with the value entered by the machine operator.

Set assignment type

  • Expression: You can set the variable to an expression, or create a new variable.

    • Variable Synchronize: Once checked, the variable with a value can be assigned at the correct point in time.
  • Operator: You can set the type of input variable; when the program runs to this node, the operator needs to manually enter the variable for value assignment.

    • Operator Message: Prompts can be added to help the operator enter the correct variable.

Synchronize/Variable Synchronize

The robot operates under the guidance of two pointers: the Advanced Pointer and the Main Pointer. The Main Pointer corresponds to the robot's movements, mirroring the execution of the robot's program in real life. The Advanced Pointer allows you to predict upcoming motion commands and, based on these predictions, calculate blending parameters and additional settings.

The "Synchronize/Variable Synchronize" feature is designed for synchronizing the Main Pointer with the Advanced Pointer. During program execution, the system will first interpret and execute the codes in sequence. A variable assignment code will execute the assignment operation immediately after interpretation. And a motion instruction will be added to the motion queue to wait for execution after interpretation.

The following two pseudo-code examples show the status of the code when the "Synchronize" feature is on or off, respectively:

  1. When the "Synchronize" feature is off: a=0 is interpreted, immediately followed by execution of the variable assignment operation, and then ... is interpreted and added to the motion queue to wait for execution. Next, a=1 will be interpreted, immediately followed by execution of the variable assignment operation. Afterwards, moveJ(a) is interpreted, at which point the system obtains the value of a to interpret moveJ(a), and then adds it to the motion queue to wait for execution. Since a=1 has been interpreted and executed assignment operation when moveJ(a) is interpreted, moveJ(a) obtains a value of 1 for a.
  2. When the "Synchronize" feature is on: a and ... are interpreted in turn, and a=0 executes the variable assignment operation while ... is added to the motion queue to wait for operation. Then a=1 is interpreted while the INST[] algorithm is added. At this point, a=1 does not immediately execute the assignment operation, but is added to the motion queue to wait for execution, and 1 will be assigned to a only when the motion queue runs to the instruction. Next, the system continues to interpret moveJ(a). Since a=1 has not been processed in the motion queue, the value of a obtained when moveJ(a) is interpreted will be 0.
Unsynchronize Synchronize
a=0
....
a=1
moveJ(a) -- a=1
a=0
....
INST[[ a=1 ]]
moveJ(a) -- a=0

Note: a=0 and a=1 are variable assignment instructions, INST[] represents the algorithm of the Synchronize feature, moveJ(a) represents the joint motion that requires the value of variable a, and ... represents other instructions that include motion.

results matching ""

    No results matching ""