Guidelines For String Data Types; Plc-5/Slc 500 Access Of Strings - Allen-Bradley ControlLogix 1756 Reference Manual

Controllers design considerations
Hide thumbs Also See for ControlLogix 1756:
Table of Contents
Guidelines for String
Data Types
Guideline
You can create a string data type that is longer or shorter
than the default string data type.
Only some instructions support string data types.
Use the SIZE instruction to determine the number of
characters in a string,
Use the DTOS, RTOS, and CONCAT instructions to embed
tag values within a string.
Set the LEN field to indicate the number characters that
are present.
PLC-5/SLC 500 Access of
Strings
String data types are structures that hold ASCII characters. The first member of
the structure defines the length of the string; the second member is an array that
holds the actual ASCII characters.
Description
The default string data type can contain as many as 82 characters, but you can create custom-length string data types to
hold as many characters as needed.
These comparison instructions support string tags: EQU, NEQ, GRT, GEG, LES, LEQ, CMP.
These serial port instructions support string tags: ARD, ARL, AWA, AWT.
These string-handling instructions support string tags: STOD, DTOS, STOR, RTOS, CONCAT, MID, FIND, DELETE, INSERT,
UPPER, LOWER, SIZE.
These file instructions support string arrays: FAL, FFL, FFU, LFL, LFU, COP, CPS, FSC.
By determining the number of characters in a string at runtime, you can write reusable code that adjusts itself to meet
each instance where it is used.
The SLC 500 processor supports the ability to embed a data-table reference address within a string (inline indirection).
The SLC 500 AWA and AWT instructions can then look up the data value and place an ASCII representation into the
outgoing string. The Logix5000 controller does not directly support this ability. Use the DTOS or RTOS instructions to
convert a value to a string and the CONCAT instruction to merge characters with another string.
The LEN field in the string structure indicates how many characters are in the string. RSLogix 5000 software and the
controller instructions that manipulate strings use the LEN value to determine how many positions in the string DATA
array contain valid characters. Both RSLogix 5000 software and the instructions stop processing the DATA array once they
reach the LEN value.
The ASCII A data table in the PLC-5 and SLC 500 processors uses a string
format that is similar to the Logix string data type. The main difference is that the
LEN field (length) in a PLC-5/SLC 500 processor is a 16-bit, INT value. The
LEN field in a Logix5000 controller is a 32-bit, DINT field. This difference can
impact converted logic and data communication. The Logix5000 controller
converts the LEN field to the appropriate value and size when a PLC-5/SLC 500
message format is used to read or write a string.
AB Drives
Rockwell Automation Publication 1756-RM094I-EN-P - September 2015
Address Data
Chapter 4
61
Table of Contents
loading

Table of Contents