
TMCM-142 TMCL
TM
Firmware Manual (V1.06 / 2014-JUN-24)
19
Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG
6.4.5
Calculation commands
These commands are intended to be used for calculations within TMCL
TM
applications.
Although they could
also be used in direct mode it does not make much sense to do so.
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
ACO
39
Copy accu to coordinate
For calculating purposes there is an accumulator (or accu or A register) and an X register. When executed in
a TMCL
TM
program (in stand-alone mode), all TMCL
TM
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.
When a command that reads a value is executed in direct mode the accumulator will not be affected. This
means that while a TMCL
TM
program is running on the module (stand-alone mode), a host can still send
commands like GAP, GGP or GIO to the module (e.g. to query the actual position of the motor) without
affecting the flow of the TMCL
TM
program running on the module.