The two members or elements of the data type consist of a DINT used to store the length of the string and an array of SINT’s that store the individual characters of the string. By default the ladder programming software has a Pre-Defined String type named STRING. The default STRING data type cannot be changed, however you are welcome to make as many different User-Defined Strings as you need. The only variables that can be changed when creating a User-Defined String are the name and size of the array that holds the individual characters.
DEFAULT STRING DATA TYPE
Name: STRINGMember Data Type Style STRING.LEN DINT Decimal STRING.SINT SINT ASCII
As an example I need a string data type that stores 10 maximum characters. Rather than using the default STRING Data Type, I created a new String Data Type which holds 10 characters. This new User-Defined String uses far less memory than the default STRING Data Type.
USER DEFINED STRING DATA TYPE
Member Data Type StyleSTRING_10.LEN DINT Decimal STRING_10.SINT SINT ASCII
As seen in the screen shot I created a new String data type that holds 10 characters. Note that spaces are characters and the length of the string is 9 characters long as stored in the member .LEN.