Using user-defined data types
The core of the control system is being able to define operations based on data stored in tags. Tags support different types of data which define the size and layout of memory that is allocated for the tag. Data types can be atomic, structure, or array:
- Atomic data types. These predefined data types that are used to compose member data.Data typeDescriptionRangeBOOL1-bit boolean0 = cleared1 = setSINT1-byte integer-128 to 127INT2-byte integer-32,768 to 32,767DINT4-byte integer-2,147,483,648 to 2,147,483,647REAL4-byte floating-point number-3.402823E38to -1.1754944E-38(negative values)01.1754944E-38to 3.402823E38(positive values)
- Structure data type. A data type composed of a sequence of members. A structure tag occupies a contiguous block of memory in the controller with each member in sequence in memory.
- Array data type. A data type composed of a matrix of members. Arrays can have multiple dimensions, but all members must be off the same atomic data type.
Use user-defined data types to create your own data structure to match your machine or process. Assign a name, description, and data type for each member of the user-defined data type.
To define a user-defined data type:
- In theController Organizer, right-clickData Typesand selectNew Data Typeto open theData Type Editor.
- Type the name of the new data type (maximum 40 characters).
- Type a description of the data type (maximum 512 characters).TIP: TheSizeparameter is read-only. It states the size of this data structure in 32-bit words. This value is not calculated until the data type is saved.
- For a string data type, enter the maximum characters allowed for the string. Valid values range from 1 through 65535.
- For each member in the user-defined data type, inAdd Membertype the memberName,Data Type, andDescription. New rows are added automatically.
- ClickApplyto save and continue editing, or clickOKto save and close theData Type Editor.
Provide Feedback