AWA(Channel,Source,
SerialPortControl);
Mnemonic
Data Type
.EN
BOOL
.EU
BOOL
.DN
BOOL
.RN
BOOL
.EM
BOOL
.ER
BOOL
.FD
BOOL
.LEN
DINT
.POS
DINT
.ERROR
DINT
Description:
ASCII Serial Port Instructions (ABL, ACB, ACL, AHL, ARD, ARL, AWA, AWT)
Structured Text
The operands are the same as those for the relay ladder AWA instruction.
However, you specify the Serial Port Control Length and the Characters Sent
values by accessing the .LEN and .POS members of the
SERIAL_PORT_CONTROL structure, rather than by including the values in
the operand list.
SERIAL_PORT_CONTROL Structure
Description
The enable bit indicates that the instruction is enabled.
The queue bit indicates that the instruction entered the ASCII queue.
The done bit indicates when the instruction is done, but it is asynchronous to the logic scan.
The run bit indicates that the instruction is executing.
The empty bit indicates that the instruction is done, but it is synchronous to the logic scan.
The error bit indicates when the instruction fails (errors).
The found bit does not apply to this instruction.
The length indicates the number of characters to send.
The position displays the number of characters that were sent.
The error contains a hexadecimal value that identifies the cause of an error.
The AWA instruction does the following:
· Sends the specified number of characters (Serial Port Control Length) of
the Source tag to the device that is connected to the serial port of the
controller
· Adds to the end of the characters (appends) either one or two characters
that are defined in the Controller Properties dialog box, User Protocol tab
Follow these guidelines to program the AWA instruction.
1. Configure the serial port of the controller.
a. Does your application also include ARD or ARL instructions?
If
Yes
No
b. Define the characters to append to the data.
2. This is a transitional instruction.
· In relay ladder, toggle the rung-condition-in from cleared to set each
time the instruction should execute.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Then
Select User mode
Select either System or User mode
Chapter 17
599