6 - 159
6 MOTION PROGRAMS FOR POSITIONING CONTROL
6.16.20 Bit device operation on condition (IF, THEN, SET/RST/OUT)
Code
IF, THEN, SET/RST/OUT
Function
Bit device operation on
condition
When the condition consists, a specified device is turned on.
Format
Device turn ON and OFF on
condition.
(Y, M, B, F, special M)
ON device (Y, M, B, F, special M)
OFF device (Y, M, B, F, special M)
F
I
[
H N
T E
]
y ;
OUT Y
#
F
I
[
H N
T E
]
y ;
SET Y
#
conditional expression
conditional expression
conditional expression
F
I
[
H N
T E
]
y ;
RST Y
#
[Explanation]
(1) When the condition consists, "IF [conditional expression] THEN SET" turns ON a
specified device.
(2) When the condition consists, "IF [conditional expression] THEN RST" turns OFF a
specified device.
(3) When a specified device is turned ON when the condition consists, and the
condition does not consist, "IF [conditional expression] THEN OUT" turns OFF a
specified device.
[Program Example]
IF [#100 EQ0] THEN SET #Y0 ;
IF [#100 EQ0] THEN RST #Y0 ;
IF [#100 EQ0] THEN OUT #Y0 ;