User manual
TMCM-1640 TMCL Firmware V2.00 Manual (Rev. 2.00 / 2012-JUL-31) 10
www.trinamic.com
4 TMCL™
The TMCM-1640 module supports TMCL direct mode and standalone TMCL program execution. You can store
up to 2048 TMCL instructions on it.
In direct mode the TMCL communication over USB/RS485 follows a strict master/slave relationship. That is, a
host computer (e.g. PC/PLC) acting as the interface bus master will send a command to the module. The
TMCL interpreter on it will then interpret this command, do the initialization of the motion controller, read
inputs and write outputs or whatever is necessary according to the specified command. As soon as this step
has been done, the module will send a reply back over USB/RS485 to the bus master. The master should not
transfer the next command till then. Normally, the module will just switch to transmission and occupy the
bus for a reply, otherwise it will stay in receive mode. It will not send any data over the interface without
receiving a command first. This way, any collision on the bus will be avoided when there are more than
two nodes connected to a single bus.
The Trinamic Motion Control Language (TMCL) provides a set of structured motion control commands. Every
motion control command can be given by a host computer or can be stored on the TMCM-1640 to form
programs that run standalone on the module.
Every command has a binary representation and a mnemonic:
- The binary format is used to send commands from the host to a module in direct mode.
- The mnemonic format is used for easy usage of the commands when developing standalone TMCL
applications with the TMCL-IDE (IDE means Integrated Development Environment).
There is also a set of configuration variables for the axis and for global parameters which allow individual
configuration of nearly every function of a module. This manual gives a detailed description of all TMCL
commands and their usage.
4.1 Binary Command Format
When commands are sent from a host to a module, the binary format has to be used. Every command
consists of a one-byte command field, a one-byte type field, a one-byte motor/bank field and a four-byte
value field. So the binary representation of a command always has seven bytes.
When a command is to be sent via USB interface, it has to be enclosed by an address byte at the beginning
and a checksum byte at the end. In this case it consists of nine bytes.
The binary command format for USB and RS485 is structured as follows:
Bytes
Meaning
1
Module address
1
Command number
1
Type number
1
Motor or Bank number
4
Value (MSB first!)
1
Checksum