User manual

TMCM-1640 TMCL Firmware V2.00 Manual (Rev. 2.00 / 2012-JUL-31) 14
www.trinamic.com
4.5.5 Calculation Commands
These commands are intended to be used for calculations within TMCL applications in standalone mode,
only. For calculating purposes there are an accumulator (or accu or A register) and an X register. When
executed in a TMCL program (in standalone mode), all TMCL commands that read a value store the result in
the accumulator. The X register can be used as an additional memory when doing calculations. It can be
loaded from the accumulator.
Mnemonic
Command number
Meaning
CALC
19
Calculate using the accumulator and a constant value
CALCX
33
Calculate using the accumulator and the X register
AAP
34
Copy accumulator to an axis parameter
AGP
35
Copy accumulator to a global parameter
MIXING STANDALONE PROGRAM EXECUTION AND DIRECT MODE
It is possible to use some commands in direct mode while a standalone program is active. When a
command which reads out a value is executed (direct mode) the accumulator will not be affected. While a
TMCL program is running standalone on the module, a host can still send commands like GAP and GGP to it
(e.g. to query the actual position of the motor) without affecting the flow of the TMCL program running
standalone on the module.