![Trinamic TMCM-351 Скачать руководство пользователя страница 42](http://html1.mh-extra.com/html/trinamic/tmcm-351/tmcm-351_firmware-manual_1163054042.webp)
TMCM-351 TMCL Firmware V4.45 Manual (Rev. 1.06 / 2014-MAY-16)
42
www.trinamic.com
4.6.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 standalone operation only.
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
Function
Target-
address
Instruction
Number
Type
Motor/
Bank
Operand
Byte3
Operand
Byte2
Operand
Byte1
Operand
Byte0
Value (hex)
$01
$14
$00
$00
$00
$00
$03
$e8