622 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 19 ASCII Conversion Instructions (STOD, STOR, DTOS, RTOS, UPPER, LOWER)
You can also use the following instructions to compare or manipulate
ASCII characters.
String Data Types
You store ASCII characters in tags that use a string data type.
· You can use the default STRING data type. It stores up to 82 characters.
· You can create a new string data type that stores less or more characters.
To create a new string data type, see the Logix5000 Controllers Common
Procedures Programming Manual, publication 1756-PM001
.
Each string data type contains the following members.
If you want to Use this instruction Page
Add characters to the end of a string CONCAT 610
Delete characters from a string DELETE 612
Determine the starting character of a sub-string FIND 614
Insert characters into a string INSERT 616
Extract characters from a string MID 618
Rearrange the bytes of a INT, DINT, or REAL tag SWPB 311
Compare a string to another string CMP 221
See if the characters are equal to specific characters EQU 226
See if the characters are not equal to specific characters NEQ 257
See if the characters are equal to or greater than specific characters GEQ 230
See if the characters are greater than specific characters GRT 234
See if the characters are equal to or less than specific characters LEQ 238
See if the characters are less than specific characters LES 242
Find a string in an array of strings FSC 361
Name Data Type Description Notes
LEN DINT Number of characters in
the string
The LEN automatically updates to the new count of characters whenever you do the
following:
·Use the String Browser dialog box to enter characters.
·Use instructions that read, convert, or manipulate a string.
The LEN shows the length of the current string. The DATA member may contain additional,
old characters, which are not included in the LEN count.
DATA SINT array ASCII characters of the
string
·To access the characters of the string, address the name of the tag.
For example, to access the characters of the string_1 tag, enter string_1.
·Each element of the DATA array contains one character.
·You can create new string data types that store less or more characters.