596 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 17 ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)
· In structured text, condition the instruction so that it executes only on a
transition.
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: Continuously test the buffer for a message from a MessageView terminal. Since
each message ends in a carriage return ($r), the carriage return is configured as the
termination character in the Controller Properties
dialog box, User Protocol tab. When the ABL finds a carriage return, its sets the
FD bit.
When the ABL instruction finds the carriage return (MV_line.FD is set), the
controller has received a complete message. The ARL instruction removes the
characters from the buffer, up to and including the carriage return, and places
them in the DATA member of the MV_msg 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 the specified 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.
/
MV_line.EN
EN
DN
ER
ASCII Test For Buffer Line
Channel 0
SerialPort Control MV_line
Character Count 0
ABL