PD42-1270 TMCL
™
Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02
31 / 91
3.6.12
COMP (Compare)
The specified 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 sepcified value. The internal arithmetic
status flags 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 (don’t care)
0 (don’t care)
<operand>
Example
Jump to the address given by the label when the position of motor #0 is greater than or equal to 1000.
1
GAP 1, 0
// get actual position of motor 0
COMP 1000
// compare actual value with 1000
3
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
Read entire documentation.