
161
Part 4 Commands
WT
(Wait for I/O port, flag)
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 WT
I/O, flag
(Time)
TU
[Function] Wait for the I/O port or flag specified in operand 1 to turn ON/OFF.
The program can be aborted after the specified time by setting the time in operand 2.
The setting range is 0.01 to 99 seconds.
The output will turn ON upon elapse of the specified time (only when operand 2 is
specified).
(Note)
A local flag cannot be specified for operand 1.
WT
ON
Wait for the applicable I/O port or flag to turn ON.
OF
Wait for the applicable I/O port or flag to turn OFF.
[Example 1]
WTON
15
Wait for input port 15 to turn ON.
[Example 2]
WTOF
308
10
Wait for 10 seconds for output port 308 to turn OFF.
[Example 3]
LET
1
600
Assign 600 to variable 1.
WTON
*1
Wait for the content of variable 1 (flag 600) to turn ON.
[Example 4]
LET
1
8
Assign 8 to variable 1.
LET
2
5
Assign 5 to variable 2.
WTOF
*1
*2
Wait for the content of variable 2 (5 seconds) for the
content of variable 1 (input port 8) to turn OFF.
162
Part 4 Commands
IN (Read I/O, flag as binary)
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 IN I/O, flag
I/O, flag
CC
[Function] Read the I/O ports or flags from the one specified in operand 1 through the other specified
in operand 2, to variable 99 as a binary.
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
Binary
15 14 13 12 11 10 9 8 Input port number
ON OFF OFF OFF OFF
ON
OFF
ON
1 0 0 0 0 1 0 1
Binary
2
7
+ 0 + 0 + 0 + 0 + 2
2
+ 0 + 2
0
128 + 0 + 0 + 0 + 0 + 4 + 0 + 1
= 133
133
Variable 99
(Note 1)
A maximum of 32 bits can be input.
(Note 2)
When 32 bits have been input and the most significant bit is ON, the value read to variable
99 will be treated as a negative value.
(Note 3)
The data format used for read can be changed using a FMIO command (refer to the
explanation of the FMIO command).
[Example 1]
IN
8
15
Read input ports 8 through 15, to variable 99 as a
binary.
[Example 2]
LET
1
8
Assign 8 to variable 1.
LET
2
15
Assign 15 to variable 2.
IN
*1
*2
Read the input ports from the content of variable 1
(input port 8) through the content of variable 2 (input
port 15), to variable 99 as a binary.
164
Summary of Contents for X-SEL PX
Page 1: ...Operation ManualSeventh Edition X SEL Controller PX QX Type Tenth Edition ...
Page 2: ......
Page 8: ......
Page 14: ......
Page 410: ...383 Appendix 386 ...
Page 452: ...425 Appendix 5 428 ...
Page 559: ......