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 type
    Description
    Range
    BOOL
    1-bit boolean
    0 = cleared
    1 = set
    SINT
    1-byte integer
    -128 to 127
    INT
    2-byte integer
    -32,768 to 32,767
    DINT
    4-byte integer
    -2,147,483,648 to 2,147,483,647
    REAL
    4-byte floating-point number
    -3.402823E
    38
    to -1.1754944E
    -38
    (negative values)
    0
    1.1754944E
    -38
    to 3.402823E
    38
    (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:
  1. In the
    Controller Organizer
    , right-click
    Data Types
    and select
    New Data Type
    to open the
    Data Type Editor
    .
  2. Type the name of the new data type (maximum 40 characters).
  3. Type a description of the data type (maximum 512 characters).
    TIP: The
    Size
    parameter 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.
  4. For a string data type, enter the maximum characters allowed for the string. Valid values range from 1 through 65535.
  5. For each member in the user-defined data type, in
    Add Member
    type the member
    Name
    ,
    Data Type
    , and
    Description
    . New rows are added automatically.
  6. Click
    Apply
    to save and continue editing, or click
    OK
    to save and close the
    Data Type Editor
    .
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.