ASCII Message Formats
Original instructions
ASCII messages are used to send information from the 140 ESI 062 10 module to ASCII devices, e. g., terminal programs. The ASCII message formats define how data contained in the CPU get converted to a stream of serial characters and vice versa.
The following table lists the available message formats:
Format
Direction
Description
Text
Output
Static text
ASCII
Output/Input
ASCII characters
Hexadecimal
Output/Input
Hexadecimal numbers
Octal
Output/Input
Octal numbers
Binary
Output/Input
Binary numbers
Integer
Output/Input
Integer numbers
Fixed Point Decimal
Output/Input
Fixed Point Decimal numbers
Time/Date
Output
Time/Date information
Control Characters
Output
Space and Newline characters
Control Sequences
Output
3 digit octal control characters
Nesting
Output/Input
Nesting of messages
Text Format
An arbitrary ASCII string enclosed in single quotes (e.g. 'message string') is an output only format. Any message that contains this format sends the text, whether or not the message is started from a read or write message command.
’. . . (text) . . .’
ASCII Format
Here is a variable field of the ASCII format with number of registers and field length:
nAm
where:
For example, 2A2 as an input stands for 2 registers, each containing 2 ASCII characters.
Hexadecimal Format
Here is a variable field of the hexadecimal format with number of registers and field length:
nHm
where:
For example, 2H3 as an input stands for 2 registers, each containing 3 hexadecimal numbers.
Octal Format
Here is a variable field of the octal format with number of registers and field length:
nOm
where:
For example, 3O4 as an input stands for 3 registers, each containing 4 octal numbers.
Binary Format
Here is a variable field of the binary format with number of registers and field length:
nBm
where:
For example, 1B8 as an input stands for 1 register containing 8 binary numbers.
Integer Format, Leading Spaces
Here is a variable field of the integer/decimal format using the leading spaces for the output with number of registers and field length. On input, this format accepts leading zeros and spaces as a zero.
nIm
where:
For example, 2I5 as an input stands for 2 registers, each containing 5 integer/decimal numbers. The maximum value is 65,535.
Integer Format, Leading Zeroes
Here is a variable field of the integer/decimal format using the leading zeroes for the output with number of registers and field length. On input this format accepts leading zeroes and spaces as a zeros.
nLm
where:
For example, 3L5 as an input stands for 3 registers, each containing 5 integer/decimal numbers. The maximum value is 65,535.
Fixed-point Decimal Format
Here is a variable field of the fixed-point decimal format using leading spaces for the output with number of registers and field length. On input, this format accepts leading zeros and spaces as a zeros.
nPm.q
where:
For example 1P7.2 as an input stands for 1 register containing 4 decimal numbers followed by a decimal point and 2 more decimal numbers (the fraction part).
NOTE: Do not confuse this format with floating point format. The placement of the decimal point is for input/output formatting and has no influence on the value in the PLC register (e.g., all 3 values 23.456, 234.56 and 23456 refer to a register value of 23456).
Nested Message Format
The nesting message format allows one message to call another message. This format can be used within the repeat format. Repeat formats can be used in nested messages, allowing indirect nested repeats. The maximum allowable nested message level is 8. Recursive nesting is not allowed.
Mn
where n is the message number 1..255
For example, M6 runs message number 6.
Time Formats
Two different time formats can be used to display time, 12-hour format and 24-hour format. This is an output-only format.
T12 > hh:mm:ss AM/PM (12 hour time)
T24 > hh:mm:ss (24 hour time)
Date Formats
Five different date formats can be used to display the date, each having 2 types of formats for displaying the year. This is an output-only format.
Dnm
where:
D12 > dd/mm/yy
D14 > dd/mm/yyyy
D22 > mm/dd/yy
D24 > mm/dd/yyyy
D32 > dd mmm yy
D34 > dd mmm yyyy
D42 > mmm dd, yy
D44 > mmm dd, yyyy
D52 > dd.mm.yy
D54 > dd.mm.yyyy
dd = day (1..31)
mm = month (1..12)
mmm = month (JAN, FEB, .. , DEC)
yy = year (0..99) (90 - 99 in 1900's, 0 - 89 in 2000's)
yyyy = year (1990..2089)
Repetition of Several Formats
Nesting of repeat brackets is not valid.
n(...)
where n is the number of times to repeat what is in ( )1. .99
For example: 6(’Item’,1I2,4X,1I5,/) produces 6 lines, each containing the fields ’Item’,1I2,4X,1I5, and a <CR, LF>.
Space
The ASCII message symbol for space is X. This is an output only format.
nX
where n is the number of spaces 1..99
Newline
The ASCII message symbol for a carriage return is /. This is an output-only format.
Control Codes
Control codes appear as 3-digit octal characters (in the range 000 377) enclosed in double quote delimiters. This is an output-only format.
"###"
where ### is the octal form of a character
For example: "033".
Flush
Flush the input buffer of the currently running serial port in one of four ways—the entire buffer, a number of characters, up to a character pair, or up to a character pair repeatedly
<0> flush entire buffer
<1;bbb> flush until number of characters removed
<2;hhhh> flush until character pair match
<3;rrr;hhhh> flush until character pair match repeatedly
where:
NOTE: The port buffer size is 255 characters.
ASCII Message Syntax Rules
Messages created with the module's ASCII Message Editor or downloaded using the ASCII Message Transfer are checked after being entered for general and format syntax violations. If any violations are found, the message either is not saved (ASCII Message Transfer) or the user is notified and the violation is pointed out (ASCII Message Editor).
Standard ASCII Message Preprocessing Rules
Messages created with the Module's ASCII Message Editor or downloaded using the ASCII Message Transfer are preprocessed after being entered to save space and to standardize the messages for interpretation during simulation or running mode.