User Manual

PD42-1240 TMCL
Firmware Manual Firmware Version V1.45 | Document Revision V1.02 2018-DEC-03
71 / 132
3.6.35 CALCVA (Calculate using a User Variable and the Accumulator Register)
The CALCVA instruction directly modies a user variable using an arithmetical operation and the contents
of the accumulator register. The parameters of this command are the arithmetic function and the index of
a user variable (0. . . 255). This command is mainly intended for use in standalone mode.
Related commands: CALCV, CALCAV, CALCVX, CALCXV, CALCVV.
Mnemonic: CALCVA <operation>, <var>
Binary representation
Binary Representation
Instruction Type Motor/Bank Value
41 0 ADD add accumulator to <var> 0 <var> (0. . . 255) 0 (dont care)
1 SUB subtract accumulator from <var>
2 MUL multiply <var> with accumulator
3 DIV divide <var> by accumulator
4 MOD modulo divide <var> by accumulator
5 AND logical and <var> with accumulator
6 OR logical or <var> with accumulator
7 XOR logical exor <var> with accumulator
8 NOT copy logical inverted accumulator to <var>
9 LOAD copy accumulator to <var>
10 SWAP swap contents of <var> and accumulator
11 COMP compare <var> with accumulator
Reply in Direct Mode
Status Value
100 - OK the operand (dont care)
Example
Subtract accumulator from user variable #27.
Mnemonic: CALCVA SUB, 27
©2018 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com