Program Execution

The TML programs are executed sequentially, one instruction after the other. A 16-bit instruction pointer (IP) controls the program flow. As the binary code of a TML instruction may have up to 5 words, during its execution the IP is increased accordingly. When the execution of a TML instruction ends, the IP always points to the next TML instruction, or more exactly to the first word of its binary code.

The sequential execution may be interrupted by one of the following causes:

A TML command received through a communication channel (on-line commands);
A branch to the interrupt service routine (ISR) when a TML interrupt occurs;
The need to send the master position to the slave axes when the current axis is set as master for electronic gearing or camming
A GOTO, CALL or CALLS instruction;
A return from a TML function – RET or from a TML interrupt – RETI;
During the execution of the instructions: WAIT! (wait event), SEG (new contour segment), PVTP or PT (new PVT or PT point) if the buffer is full, and data transfers between axes of type local_variable = [x]remote_variable, which all keep the IP unchanged (i.e. loop on the same instruction) until a specific condition is achieved
After execution of the END instruction.

The on-line commands have the highest priority and act like interrupts: when an on-line command is received through any communication channel, it starts to be executed immediately after the current TML instruction is completed.

If an on-line command is received during a wait loop, the wait loop is temporary suspended, to permit the execution of the on-line command.

The TML works with 3 types of commands, presented in table below.

TMLInstructionType

The immediate commands may be sent via a communication channel, or can reside in a TML program. These commands don’t require any wait loops to complete. Their execution is straightforward and can’t be interrupted by other TML commands.

The sequential commands require a wait loop to complete i.e. will not permit the IP to advance until the wait condition becomes true. In this category enter commands like:

WAIT!;        // Wait a programmed event to occur

SEG Time, Increment;        // Set a contour segment with parameters Time and

//Increment to be executed when the previous one ends

local_variable = [x]remote_variable;        // Get value of remote_variable from

//axis x and put it in local_variable

The sequential commands can reside only in a TML program saved in the local memory.

Remark: If a sequential command is sent via a communication channel, it is immediately executed as if the wait loop condition is always true.

The on-line commands may be sent only via a communication channel. These commands can’t be included in a TML program. The on-line commands do not have an associated mnemonic and syntax rules as they are do not need to be recognized by the TML compiler. Their code is known only by the “TML processor”.

Remark: Some of the on-line commands are implemented in debugging tools like the Command Interpreter, which was specifically designed to allow sending commands via a communication channel. These commands are presented with a “mnemonic” like that used in the Command Interpreter. The Command Interpreter is a component present in all the Technosoft applications for drives/motors setup and TML programming: EasySetUp, EasyMotion Studio, IPM Motion Studio.

 

Basic Concepts next topics:

TML Program Structure

TML Instruction Coding

TML Data

Memory Map – Firmware version FAxx

Memory Map – Firmware version FBxx

AUTORUN mode

 

See also:

Basic Concepts

TML Description