![Trinamic PD57-1060 Скачать руководство пользователя страница 63](http://html1.mh-extra.com/html/trinamic/pd57-1060/pd57-1060_firmware-manual_1163104063.webp)
PD57/60-1060 / TMCM-1060 TMCL™ Firmware Manual (V1.04 / 2011-AUG-29)
63
Copyright © 2011, TRINAMIC Motion Control GmbH & Co. KG
5.7.17
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 stand-
alone operation only.
The host address and the reply are only used to take the instruction to the TMCL™ program memory
while the program loads down. It does not make sense to use this command in direct mode.
Internal function:
The specified value is compared to the internal "accumulator", which holds the value of a
preceding "get" or calculate instruction (see GAP/GGP/GIO/CALC/CALCX). The internal arithmetic status flags
are set according to the comparison result.
Related commands:
JC (jump conditional), GAP, GGP, GIO, CALC, CALCX
Mnemonic:
COMP <value>
Binary representation:
INSTRUCTION NO.
TYPE
MOT/BANK
VALUE
20
don’t care
don’t care
<comparison value>
Example:
Jump to the address given by the label when the position of motor is greater than or equal to 1000.
GAP 1, 2, 0
//get axis parameter, type: no. 1 (actual position), motor: 0, value: 0 don’t care
COMP 1000
//compare actual value to 1000
JC GE, Label
//jump, type: 5 greater/equal, the label must be defined somewhere else in the
program
Binary format of the COMP 1000 command:
Byte Index
0
1
2
3
4
5
6
7
8
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Checksum
Value (hex)
$01
$14
$00
$00
$00
$00
$03
$e8
$00