592 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 17 ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)
4. To trigger a subsequent action when the instruction is done, examine the
EM bit.
Arithmetic Status Flags: Not affected
Fault Conditions: None
Execution:
Example: A bar code reader sends bar codes to the serial port (channel 0) of the controller.
Each bar code contains 24 characters. To determine when the controller receives a
bar code, the ACB instruction continuously counts the characters in the buffer.
When the buffer contains at least 24 characters, the controller has received a bar
code. The ARD instruction moves the bar code to the DATA member of the
bag_bar_code tag, which is a string.
Relay Ladder
Condition Relay Ladder Action Structured Text Action
Prescan The rung-condition-out is set to false. No action taken.
Rung-condition-in is false The rung-condition-out is set to false. N/A
Rung-condition-in is true The instruction executes when rung-condition-in toggles
from cleared to set.
The rung-condition-out is set to true.
N/A
EnableIn is set N/A EnableIn is always set.
The instruction executes.
Instruction execution The instruction removes characters from the buffer and stores them in the destination.
The .EN bit is set.
The remaining status bits, except .UL, are cleared.
The instruction attempts to enter the ASCII queue.
Postscan The rung-condition-out is set to false. No action taken.
/
bar_code_count.EN
EN
DN
ER
ASCII Chars in Buffer
Channel 0
SerialPort Control bar_code_count
Character Count 0
ACB
Grtr Than or Eql (A>=B)
Source A bar_code_count.pos
0
Source B 24
GEQ
EN
DN
ER
ASCII Read
Channel 0
Destination bag_bar_code
''
SerialPort Control bar_code_read
SerialPort Control Length 24
Characters Read 0
ARD