Installation manual

Publication 1747-RM001G-EN-P - November 2008
ASCII Instructions 10-17
ASCII Read Line (ARL)
Use the ARL instruction to read characters from the buffer, up to and
including the end-of-line (termination) characters, and store them in a string.
The end-of-line characters are specified via the ASCII Configuration screen.
Entering Parameters
Enter the following parameters when programming this instruction.
Channel is the number of the RS-232 port (Channel 0).
Destination is the string element where you want the characters stored.
Control is the address of the control block used to store data for the
ARL instruction.
String Length (LEN) is the number of characters you want to read
from the buffer. The maximum is 82 characters. If you specify a length
larger than 82, only the first 82 characters are read and moved to the
destination. (A 0 defaults to 82.) This is word 1 in the control block.
Characters Read (POS) are the number of characters that the
processor moved from the buffer to the string (0 to 82). This field is
display only and resides in word 2 of the control block.
Error displays the hexadecimal error code that indicates why the ER bit
was set in the control data file (R6). See page 10-24 for error code
descriptions.
Example
When the rung goes from false-to-true, the control element Enable (EN) bit is
set. When the instruction is placed in the ASCII queue, the Queue bit (EU) is
set. The Running bit (IN) is set when the instruction is executing. The DN bit
is set upon completion of the instruction.
Once either the end of line character(s) are received or, the requested number
of characters are in the buffer, all characters (including the end-of-line
characters) are moved to the destination string. The number of characters
moved is stored in the POS word of the control block. The number in the
Characters Read field is continuously updated and the Done bit (DN) is not
set until either the end of line character(s) are received or, all of the characters
have been read.
EN
DN
ER
ARL
ASCII Read Line
Channel 0
Dest ST10:8
Control R6:6
String Length 16<
Characters Read 0
Error 0
ARL
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
•••