IAI America SSEL User Manual
Page 148
126
Part 2 Programs
z 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 read data format can be changed using a FMIO command (refer to the section on 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.