User Manual

TMCM-3230 TMCL
Firmware Manual Firmware Version V1.07 | Document Revision V1.05 2017-OCT-10
41 / 103
3.6.15 COMP (Compare)
The specied number is compared to the value in the accumulator register. The result of the comparison
can for example be used by the conditional jump (JC) instruction. This command is intended for use in
standalone operation only.
Internal function:
The accumulator register is compared with the sepcied value. The internal arithmetic
status ags are set according to the result of the comparison. These can then control e.g. a conditional
jump.
Related commands: JC, GAP, GGP, GIO, CALC, CALCX.
Mnemonic: COMP <operand>
Binary Representation
Instruction Type Motor/Bank Value
20 0 (dont care) 0 (dont care) <operand>
Example
Jump to the address given by the label when the position of motor #0 is greater than or equal to 1000.
GAP 1, 0 //get actual position of motor 0
2
COMP 1000 //compare actual value with 1000
JC GE, Label // jump to Lable if greter or equal to 1000
Binary Form of COMP 1000
Field Value
Target address 01
h
Instruction number 14
h
Type 00
h
Motor/Bank 00
h
Value (Byte 3) 00
h
Value (Byte 2) 00
h
Value (Byte 1) 03
h
Value (Byte 0) E8
h
Checksum 00
h
©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com