604 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 17 ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)
3. Each time the instruction executes, do you always send the same number of
characters?
Arithmetic Status Flags: Not affected
Fault Conditions: None
Execution:
Example 1: When the temperature reaches the low limit (temp_low is set), the AWT
instruction sends a message to the MessageView terminal that is connected to the
serial port of the controller. The message contains nine characters from the
DATA member of the string[2] tag, which is a string. (The $14 counts as one
character. It is the hex code for the Ctrl-T character.) The last character is a
carriage return ($r), which marks the end of the message.
Relay Ladder
If Then
Yes In the Serial Port Control Length, enter the number of characters to send.
No Before the instruction executes, move the LEN member of the Source tag to
the LEN member of the Serial Port Control tag.
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 sends a specified number of characters.
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.
temp_low
EN
DN
ER
ASCII Write
Channel 0
Source string[2]
'$142224\01$r'
SerialPort Control temp_low_write
SerialPort Control Length 9
Characters Sent 9
AWT