AWT (ASCII write)

The AWT instruction writes ASCII characters from a source string to an external device.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L20E, L50E, and L70E controllers.
AWT
AWT
AWT parameters
Parameter
Parameter Type
Data Type
Description
IN
Input
BOOL
Rung input state.
  • TRUE: When Rising Edge is detected, start the instruction block with the precondition that the last operation is complete.
  • FALSE: The instruction block is idle.
AWTInput
Input
AWAAWT
The channel and number (Length) of the characters to write to the buffer. The maximum is 82.
Use the AWAAWT data type to define Channel, Length, and Cancel parameters for AWTInput.
Source
Input
ASCIILOCADDR
The source string that was output as a character array by either the ARD or ARL instruction.
Q
Output
BOOL
Indicates when the write is ongoing or complete.
Outputs of this instruction are updated asynchronously from the program scan. Output Q cannot be used to re-trigger the instruction because IN is edge triggered.
  • TRUE: The function block is complete.
  • FALSE: The function block is not complete.
NumChar
Output
UINT
The number of characters. NumChar might be less than the Length requested to be transmitted if the length of the Source String is shorter than the requested Length.
Updates when the transmission is complete and Q is TRUE.
Error
Output
BOOL
Indicates the existence of an error condition.
  • TRUE: An error is detected.
  • FALSE: No error.
ErrorID
Output
UINT
A unique numeric that identifies the error. The errors for this instruction are defined in ABL error codes.
AWT error codes
Error code
Error description
03
Transmission cannot be completed because the Clear-to-Send signal was lost.
06
Illegal parameter was detected.
07
Cannot complete ASCII send or receive because channel configuration has been shut down using the channel configuration dialog.
08
Cannot complete ASCII Write due to an ASCII transmission already in progress.
09
ASCII communication requested is not supported by current channel configuration.
10
The Cancel was set, stopping instruction execution. No action required.
11
The requested length for the string is either invalid, a negative number, greater than 82, or 0. Applies to ARD and ARL function blocks.
13
The requested (.LEN) in the control block is a negative number or a value greater than the string size stored with the source string. Applies to AWA and AWT function blocks.
14
The ACL function block was canceled.
16
Serial port is not supporting RTS or CTS control lines.

AWT examples

AWT function block diagram example
AWT function block diagram example
AWT ladder diagram example
AWT ladder diagram example
AWT structured text example
AWT structured text example
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal