User guide

- 40 -
READ (Read) [* When the Ethernet option is used]
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 READ
Channel
number
Column
number
CC
[Function] Read a character string from the channel specified in operand 1 to the column specified in
operand 2.
The reading will end upon reaching the character specified with an SCHA command.
Either a local or global column may be specified.
(Note 1) Channel Nos. 31 through 34 can be specified in operand 1 with the Ethernet option.
(Note 2) Be sure to design the program in such a way that the normal completion or abnormal completion
of the return code will always be confirmed before moving on to the next process.
[Example]
SCHA 10 Specify 10 (= LF) as the end character.
READ 31 5 991 Read a character string from channel 31 to column 5
until LF is reached.
TRAN 2 99 Store the return code in variable 2.
N 991 GOTO 16 READ failed Proceed to error handling or retry
process after closing.
Common return codes of OPEN, READ and WRIT commands [* When the Ethernet option is used]
The return code is stored in the local variable specified in “Other parameter No. 24.” The default setting is
variable 99. For details on the return code, refer to the page describing the “OPEN” command.