Topic: P132

ASCII Out (AOUT) Instruction

Mnemonic (Keyboard Shortcut) = AOUT w

Icon / Button =

Purpose

Send ASCII String data out of the Serial Ports of the CPU for the purpose of device control, data printing, or displaying data on simple operator interfaces.


Instruction Parameters

Parameter

Parameter Type

Requirements

Description

Enable

Ladder Input

Must Have

Edge-driven.  When Enable transitions from OFF to ON, the instruction will operate for one scan.

Serial Port

Drop Down Selection

Must Have

The Serial Port from where ASCII data is sent.

String

String Tag / Constant

Must Have

The field that contains the String Tag or the String Constant that will be sent out the serial port.  If using a String Constant, you MUST put quotes (" ") around the characters to be sent out the port.

No Termination

Selectable Option

Must select No Termination,  1 Character or 2 Characters

This option specifies that no trailing Characters will be sent out of the serial port with the data from the String field.

1 Character

Selectable Option

This option specifies that the CPU will send out 1 Character that is specified in the Termination Code 1 0x field trailing the String field data.

2 Characters

Selectable Option

This option specifies that the CPU will send out 2 Characters that are specified in the Termination Code 1 0x field and Termination Code 2 0x field trailing the String field data.

Termination Code 1 0x

Constant

Must Have when selecting 1 or 2 Characters.

Used to mark the end of a message.  Must be configured using Hexadecimal format.  When the Termination Code is sent, the CPU is signaling the end of the ASCII String.

Termination Code 2 0x

Constant

Used in conjunction with Termination Code 1 to mark the end of a message.  Must be configured using Hexadecimal format.  When Termination Code 1 and Termination Code 2 are sent (consecutively), the CPU is signaling the end of the ASCII String.

Byte Swap Option

Selectable Option

Must Have No Byte Swap, All Characters, or All But NULL Characters selected.

No Byte Swap: No Bytes will be Swapped from the String field data when being sent out of the Serial Port.

All Characters: Every Two Characters will be Swapped from the String field data when being sent out of the Serial Port.

All But Null Characters: Every Two Characters except for Null Characters will be Swapped from the String field data when being sent out of the Serial Port.

Convert 0x to  NULL

Constant

Optional

Some devices need a Space to be a 0x20 and others need a Space to be  a 0x00.  Spaces will always be stored as 0x20 in the Strings in the CPU.  This option allows the 0x20 (or other character codes) to be converted to NULL before being sent out of the Serial Port.

In Progress

Boolean Tag

Optional

This bit turns ON when the Ladder Logic attempts to send the String data out of the Serial Port.  This bit turns OFF once the data has been sent.

Complete

Boolean Tag

Optional

This bit turns ON once the String data has been successfully sent out the Serial Port.

Use Structure

Checkbox

Optional

Enables the use of Structures.


Note: One of theSerial Ports must be configured for ASCII/Custom Protocol before configuring this instruction.


Note: Tag Values are updated immediately as each Ladder Rung is executed, top to bottom.  However, Tag Values representing physical Outputs are only applied to the physical Output after the END statement of the last Task to be scanned is reached.  Outputs in Remote Base Groups have additional limitations regarding Update Intervals.


Instruction Configuration

When ASCII Out Instruction is selected the window shown below opens.

Parameter Configuration Table

ASCII Out

Instruction

(AOUT)

Notes

Serial Port

                   

Select a Serial Port.

String

               

Enter a String Tag or a String Constant in quotes.

No Termination

                   

Select for No Trailing Characters.

1 Character

                   

Select for 1Termination Character.

2 Characters

                   

Select for 2 Termination Characters.

Termination Code 1 0x

                 

Enter a Hexadecimal value.

Termination Code 2 0x

                 

Enter a Hexadecimal value.

Byte Swap Option

                   

Select a Byte Swap option.

Convert 0x to NULL

                 

Select the checkbox and enter a Character to store if 0x is received.

In Progress

                 

Select a Boolean Tag for the In Progress bit status.

Complete

                 

Select a Boolean Tag for the Complete bit status.

Use Structures

                   

Enables the use of Structures.


Timing Chart


Application Example

In this example, an Alarm Barcode String is transferred from the Communications Port of the CPU to a marquee display.  The String is terminated with a carriage return (0x0D).

Rung Example


Related Topics Link IconRelated Topics