Jumps and Function Calls Dialogue

The “Jumps and Function Calls” dialogue allows you to control the TML program flow through unconditional or conditional jumps and unconditional, conditional or cancelable calls of TML functions.

decisions

Select Goto and indicate the jump address in address, label or address set in variable. The jump address can be set directly as a numerical value (if it is known) or indirectly via:

A label. Use Insert label name to place the label in the desired location. The label name can be any string of up to 32 characters, which starts with an alphanumeric character or with underscore.
A 16-bit TML variable whose value represents the jump address.

Remark: You may assign a label to a 16-bit integer variable. The variable takes the value of the label i.e. the address of the next instruction after label. Example: user_var = jump_label;

Leave if variable unchecked to execute an unconditional jump. Check if variable to execute a conditional jump and specify a test variable and a condition. The test variable is always compared with zero. The possible conditions are: < 0, <= 0, >0, >=0, =0, 0. If the condition is true the jump is executed, else the next TML command is carried out.

Select Call and indicate the name of a TML function in address, label or address set in variable. A TML function starts with a label and ends with the RET instruction. The label gives the TML function address and name. You can create, rename or delete TML functions using the Functions View.

Remark: The TML functions are placed after the end of the main program

Similarly with the jump address, the TML function address can be set directly, as a numerical value (if it is known), or indirectly via:

The TML function starting label (i.e. the function name)
A 16-bit TML variable whose value represents the TML function address.

Leave if variable unchecked to execute an unconditional call. Check if variable to execute a conditional call and specify a test variable and a condition. The test variable is always compared with zero. The possible conditions are: < 0, <= 0, >0, >=0, =0, 0. If the condition is true the call is executed, else the next TML command is carried out.

Choose Cancelable Call and indicate the TML function address if the exit from the called function depends on conditions that may not be reached. In this case, using Abort cancelable call you can terminate the function execution and return to the next instruction after the call.

Select RETurn from function to insert the RET instruction, which ends a TML function. When RET instruction is executed, the TML program returns to the next instruction (motion sequence) after the TML function call.

Select RETurn from interrupt to insert the RETI instruction, which ends a TML interrupt. When RETI instruction is executed, the TML program returns to the point where it was before the TML interrupt occurrence.

 

OK: Close this dialogue and save the motion sequence in your motion sequence list.

Cancel: Close this dialogue without saving the motion sequence in your motion sequence list.

Help: Open this help page.

 

See also:

Jumps and Function Calls – TML Programming Details

Functions View.

Motion Programming