11 - 93 11 - 93
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
If the 03
H
code (BREAK code) is entered from a keyboard other than the console keyboard
(a terminal connected to the communication port), the BASIC program reads it as data.
Therefore, note that the BASIC program cannot be stopped.
Description
• For the input from the keyboard, the program continues waiting for the input of number of
characters specified by <numeric expression>. If the buffer contains the data that has
already been entered, the characters are read from the beginning of the buffer.
The entered characters are not displayed on the screen.
Reading from a sequential file
• When <file number> is specified after <numeric expression>, a character string of
<numeric expression> characters are read from the sequential file.
• <file number> specifies the file number set by the OPEN instruction to the corresponding
sequential file.
• When reading from a file, all of the delimiters are read as data.
• An “Input past end” error occurs if there is no data to read when trying to read from a file.
Reading from a communication port of the communication module
• If <port number> is specified after <numeric expression>, input is accepted from CH1(RS-
232C), CH2(RS-232C), and CH3(RS-422) of the communication module.
• Specify <port number> as follows:
CH1(RS-232C)
• • • •
1
CH2(RS-232C)
• • • •
2
CH3(RS-422)
• • • •
3
• All the codes including 00
H
code as well as characters can be read as data by the input
from a port.
Therefore, the BASIC program reads the 03
H
code (BREAK code) as data, and note that
the BASIC program is not stopped.
• <wait time> sets the duration to wait for the data input.
The value can be set from 0 to 255 seconds.
A “Time out error” occurs if the input of the number of bytes specified by <numeric
expression> has not occurred within the specified duration.
When 0 is specified to <wait time> or when <wait time> is omitted, the program continues
waiting until the input of the number of characters specified by <numeric expression>
occurs.
• If the buffer contains the data that has been already entered when reading from a port, the
characters are read from the beginning of the buffer.