Publication 1762-RM001C-EN-P
20-22 ASCII Instructions
ARD - ASCII Read
Characters
Instruction Type: output
Use the ARD instruction to read characters from the buffer and store them
in a string. To repeat the operation, the rung must go from false-to-true.
Entering Parameters
Enter the following parameters when programming this instruction:
•
Channel is the number of the RS-232 port, Channel 0. (For the
1764-LRP only, you can select either Channel 0 or Channel 1).
•
Destination is the string element where you want the characters
stored.
•
Control is the control data file. See page 20-6.
•
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 will be read. If you specify 0
characters, LEN defaults to 82. This is word 1 in the control data file.
•
Characters Read (POS) is the number of characters that the
controller moved from the buffer to the string (0 to 82). This field is
updated during the execution of the instruction and is read-only. This
is word 2 in the control data file.
•
Error displays the hexadecimal error code that indicates why the ER
bit was set in the control data file. See page 20-30 for error code
descriptions.
Addressing Modes and File Types can be used as shown below:
EN
DN
ER
ARD
ASCII Read
Channel 0
Dest ST10:4
Control R6:3
String Length 10<
Characters Read 0<
Error 0<
ARD
Table 20.23 Execution Time for the ARD Instruction
Controller When Instruction Is:
True False
MicroLogix 1200 Series B, FRN 3 or later 132.3
µ
s + 49.7
µ
s/character 11.8
µ
s
MicroLogix 1500 Series B, FRN 4 or later 108
µ
s + 44
µ
s/character 10.7
µ
s
Table 20.24 ARD Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page4-2.
Parameter
Data Files
(1)
(1) The Control data file is the only valid file type for the Control Element.
Function Files
CS - Comms
IOS - I/O
Address
Mode
Address
Level
O
I
S
B
T, C, R
N
ST
L
MG, PD
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
DAT
TPI
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Channel • •
Destination •
• •
Control •
• •