ETEL Doc. - Operation & Software Manual # DSC2P 903 / Ver. F / 3/6/05
Chapter D: Programming
Operation & Software Manual
Direct Drives & Systems
221
14.2.3 Conditional jump: TST, JEQ, JNE, JLT and JGT commands
To compare a register value to another register value or an immediate value with another immediate value, the
TST
command (
T
e
ST
) is first performed.
Then, if the following '
test jump
' command is true, the sequence execution will continue from the label in <P1>
(the bit# 8 of SD1 is set to 1).
The commands '
Test jump
' are:
JEQ
(
J
ump if
EQ
ual),
JNE
(
J
ump if
N
ot
E
qual),
JLT
(
J
ump if
L
i
T
tle than) and
JGT
(
J
ump if
G
rea
T
er than).
If the condition is not met, the sequence execution goes on from the line following the test.
Note:
For floating point variables (F registers), the
FTST
command replaces
TST
.
Example:
X2.1=20
;Attributes the value 20 to X2 variable.
TST.1=X1.1,25
;Compares the X1 user variable with the number 25.
JGT.1=10
;Sequence execution goes on from label 10 if X1>25.
JEQ.1=X2
;Sequence execution goes on from label 20 (value contained in the user variable X2)
if X1=25.
POS.1=50000
;If no test is right when X1<25, the sequence goes on from the following line and the
motor moves to the position 50000.
:10.1
Instruction 1
:20.1
Instruction 2
Command
<P1>, <P2>
Comment
TST.<axis> = <P1>, <P2>
2 values
Compares the values contained in registers <P1> and <P2>, or the immediate values
entered for <P1> and <P2>
Command
<P1>
Value of
<P1>
Comment
JEQ.<axis> = <P1>
<label_#>
0-511
If <P1>=<P2> the execution of the sequence goes on from label shown by <P1>.
JNE.<axis> = <P1>
If <P1>
≠
<P2> the execution of the sequence goes on from label shown by <P1>.
JLT.<axis> = <P1>
If <P1> < <P2> the execution of the sequence goes on from label shown by <P1>.
JGT.<axis> = <P1>
If <P1> > <P2> the execution of the sequence goes on from label shown by <P1>.
Содержание DSC Series
Страница 2: ...THIS PAGE IS INTENTIONALLY LEFT BLANK ...