TMCM-6212 TMCL
™
Firmware Manual • Firmware Version V1.11 | Document Revision V1.07 • 2019-JAN-25
70 / 140
3.6.34
CALCVV (Calculate using two User Variables)
The CALCVV instruction directly uses the contents of two user variables for an arithmetic operation, storing
the result in the first user variable. This eliminates the need for using the accumulator register and/or X
register for such purposes. The parameters of this command are the arithmetic function, the index of the
first user variable (0. . . 255) and the index of the second user variable (0. . . 255).
This command is mainly
intended for use in standalone mode.
Related commands:
CALCVA, CALCAV, CALCVX, CALCXV, CALCV.
Mnemonic:
CALCVV <operation>, <var1>, <var2>
Binary representation
Binary Representation
Instruction
Type
Motor/Bank
Value
40
0 ADD – add <var2> to <var1>
0 <var1> (0. . . 255)
<var2> (0. . . 255)
1 SUB – subtract <var2> from <var1>
2 MUL – multiply <var2> with <var1>
3 DIV – divide <var2> by <var1>
4 MOD – modulo divide <var2> by <var1>
5 AND – logical and <var2> with <var1>
6 OR – logical or <var2> with <var1>
7 XOR – logical exor <var2> with <var1>
8 NOT – copy logical inverted <var2> to <var1>
9 LOAD – copy <var2> to <var1>
10 SWAP – swap contents of <var1> and <var2>
11 COMP – compare <var1> with <var2>
Reply in Direct Mode
Status
Value
100 - OK
the operand (don’t care)
Example
Subtract user variable #42 from user variable #65.
Mnemonic:
CALCVV SUB, 65, 42
©2019 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at