16-3
16-2. Input/Output commands
16-2-1. IN
Format
IN [Variable]=[Terminal type] ([Terminal name])
Variable The imported terminal value is
assigned to (GB, LB).
Function Digital input.
Import and signal status from I/O port to a
variable name.
Terminal type I/O terminal type (value or variable
(GB, LB))
Condition Terminal types I4#, I8#, I16#, O4#, O8# and
O16# must be defined before to use.
Lock condition I/O lock.
I1#...............1-bit input
I4#...............4-bit input
I8#...............8-bit input
I16#.............16-bit input
O1# .............1-bit output
O4# .............4-bit output
O8# .............8-bit output
O16# ...........16-bit output
Syntax check None.
Terminal name Terminal label or number (value or
variable (GI, LI)).
Example Import the signal status from input terminal 001 of
1-bit output.
IN LB001 = I1#(001)
The same command in
conventional models
IN REG
16-2-2. OUT
Format
OUT [Terminal type] ([Terminal name]) = [Value]
Terminal type Output terminal type (value or
variable (GB, LB)).
Function Digital output.
(Output the signal to output port.)
Condition Terminal types O4#, O8# and O16# must be
defined before to use.
O1# .............1-bit output
O4# .............4-bit output
O8# .............8-bit output
O16# ...........16-bit output
Lock
condition
I/O lock. Output value ON or OFF or variable (GB, LB)
Syntax check None. Terminal name Terminal label or number (value or
variable (GB, LB)). (GI and LI for
16-bits)
The same command in
conventional models
OUTB, OUTG, OUTP,
ANALOG3
Example Turn ON the terminal 001 of 1-bit output.
OUT O1#(001) = ON
Note:
The value is converted into a binary number and bit
of the specified port from the right-hand side of such
a number is output. (0: OFF, 1: ON) For example,
Port O1#: outputs the right-hand side (the
least-significant) bit
Port O4#: outputs 4 bits from the right-hand side of
the value.