
261
Part 4 Commands
1.13 Structural IF
IF
(Structural IF)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional IF
Variable
number
Data CP
[Function] Compare the content of the variable specified in operand 1 with the value specified in
operand 2, and proceed to the next step if the condition is satisfied.
If the condition is not satisfied, the program will proceed to the step next to the
corresponding ELSE command, if any, or to the step next to the corresponding EDIF
command.
If the input condition is not satisfied and the IF
command is not executed, the program
will proceed to the step next to the corresponding EDIF.
A maximum of 15 nests are supported when IS
and DW
are combined.
IF
EQ
Operand 1 = Operand 2
NE
Operand 1
Operand 2
GT
Operand 1 > Operand 2
GE
Operand 1
Operand 2
LT
Operand 1 < Operand 2
LE
Operand 1
Operand 2
[Example
1]
SVON
1111
Set the current arm system in variable 99.
PRDQ 1
100
Read the current X coordinate into variable 100.
CPNE 99 0 600
600
IFEQ
99
1
If the arm system is indeterminable, the arm
system whose flag 600 is turned OFF will be
determined. If this arm system is also
indeterminable, the operation will end.
IFGE 100 0
MOVP
1
If the X coordinate is 0 or greater:
Move the axis to position No. 1 in PTP mode.
ELSE
MOVP
2
Move the axis to position No. 2 in PTP mode.
EDIF
ELSE
IFGE 100 0
MOVP
3
If the X coordinate is 0 or greater:
Move the axis to position No. 3 in PTP mode.
ELSE
MOVP
4
Move the axis to position No. 4 in PTP mode.
EDIF
EDIF
EXIT
If the current arm system is the right arm and the X coordinate is 0 or greater, the axis will
move to position No. 1; if the X coordinate is below 0, the axis will move to position No. 2.
If the current arm system is the left arm and the X coordinate is 0 or greater, the axis will
move to position No. 3; if the X coordinate is below 0, the axis will move to position No. 4.
(Note)
Using a GOTO command to branch out of or into an IF
-EDIF syntax is prohibited.
262
Part 4 Commands
IS
(Compare strings)
Command, declaration
Extension condition
(LD, A, O, AB, OB)
Input condition
(I/O, flag)
Command,
declaration
Operand 1
Operand 2
Output
(Output, flag)
Optional Optional IS
Column
number
Column
number,
character literal
CP
[Function] Compare the character strings in the columns specified in operands 1 and 2, and proceed
to the next step if the condition is satisfied.
If the condition is not satisfied, the program will proceed to the step next to the
corresponding ELSE command, if any, or to the step next to the corresponding EDIF
command.
Comparison will be performed for the length set by a SLEN command.
If a character literal is specified in operand 2, comparison will be performed for the entire
length of the literal.
If the input condition is not satisfied and the IS
command is not executed, the program
will proceed to the step next to the EDIF.
A maximum of 15 nests are supported when IF
and DW
are combined.
IS
EQ
Operand 1 = Operand 2
NE
Operand 1
Operand 2
[Example 1]
SCPY
10
‘GOFD’ (Move
forward)
SCPY
14
‘GOBK’ (Move
backward)
SLEN
4
Set the number of comparing characters to 4.
600
ISEQ 1 “AXSX”
(X-axis)
Select an axis.
ISEQ 5 10
Select a moving direction.
MOVL
1
Move the axis to position No. 1 in CP mode.
ELSE
MOVL
2 5
Move the axis to position No. 2 in CP mode.
EDIF
ELSE
ISNE 5 14
Select a moving direction.
MOVL
3
Move the axis to position No. 3 in CP mode.
ELSE
MOVL
4
Move the axis to position No. 4 in CP mode.
EDIF
EDIF
Move in CP mode by selecting position Nos. 1 and 2 by columns 1 to 4 and
position Nos. 3 and 4 by columns 5 to 8.
Nothing will happen if flag 600 is OFF, in which case the program will proceed to
the step next to the last EDIF.
If columns 1 to 8 contain the following data, the axis will be moved to position
No. 1 in CP mode.
1 2 3 4 5 6 7 8
AX SX GO FD
(Note)
Using a GOTO command to branch out of or into an IS
-EDIF syntax is prohibited.
264
Содержание X-SEL PX
Страница 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Страница 2: ......
Страница 8: ......
Страница 14: ......
Страница 39: ...15 Part 1 Installation Reference Circuit Diagram Surge absorber Solenoid valve Controller 0 V 15 ...
Страница 410: ...383 Appendix 386 ...
Страница 452: ...425 Appendix 5 428 ...
Страница 559: ......