Create a user-defined string data type
Use user-defined string data types to create a data structure that stores ASCII characters for
use in your machine or process. There are three pre-defined string data types:
- STRING: Stores up to 82 characters.
- STRING -32: Stores up to 32 characters.
- STRING -16: Stores up to 16 characters.
You can also define a custom string data type to store between 1 and 65,535
characters.
Each STRING data type contains these members:
Member | Data Type | Description | Notes |
LEN | DINT | Number of characters in the string. | The LEN automatically updates when using:
|
DATA | SINT array | ASCII characters of the string. | The SINT array holds the character data for the string. Each element of the DATA array contains one character as an encoded
decimal value. To access characters, use the tag name (for
example, string_1.DATA[0]). Create new string types to store more or fewer characters. |
To create a user-defined STRING data type
- In the explorer bar, select
Library. - Select theUser-defined Stringsfolder and selectNew string type.
- InNew user-defined string type, enter:
- Name. Enter a name for the data type. Enter a maximum 40 characters that comply with the IEC-61131 Name Standard.
- (optional)Description. Enter a description of the data type.
- Maximum characters. Enter the maximum number of characters that the string data type stores. You can enter a value (or use the selector buttons to designate a value) up to 65,535.
- (optional)Version Number. Use to track changes made to a data type by version number.
- (optional)Vendor. Enter a name for the vendor.
- (optional)Version Note. Enter a description to help identify changes made for the version.
- SelectCreate.
FactoryTalk Design Studio Copilot and user-defined strings
All FactoryTalk Design Studio Copilot interactions with strings are from the
FactoryTalk Design Studio Copilot chat panel.
- Create user-defined stringsPrompt: Create a user defined string called ST_001, with a description [enter description], maximum characters of [1 to 65535], version [x.x.x], Vendor is [name], and Version Note is [note on version].FactoryTalk Design Studio Copilot response:A warning that FactoryTalk Design Studio Copilot cannot complete this prompt if one of these scenarios exist:
- The name is already used or is invalid.
- The Property value is not valid.
- Create string tagsYou can enter a prompt to create string tags with the Data types of String, String_16, or String_32.Prompt: In [smart object name].[program name].[routine name], create tag [tag name] with type String (or String_16 or String_32)FactoryTalk Design Studio Copilot response: A warning that FactoryTalk Design Studio Copilot cannot complete this prompt if one of these scenarios exist:
- The name is already used or is invalid.
- The Property value is not valid.
- Create a string tag arrayPrompt: In [smart object name].[program name].[routine name], create tag [tag name] with type String with array dimension 6FactoryTalk Design Studio Copilot response: A warning that FactoryTalk Design Studio Copilot cannot complete this prompt if one of these scenarios exist:
- The name is already used or is invalid.
- The Property value is not valid.
- Add value to string tagPrompt:In [smart object name].[program name].[routine name], add value of [string] into tag [tag name]FactoryTalk Design Studio Copilot response: A warning that FactoryTalk Design Studio Copilot cannot complete this prompt if one of these scenarios exist:
- The name is already used or is invalid.
- The Property value is not valid.
Find information about FactoryTalk Design Studio Copilot prompts for:
Provide Feedback