Data Types

Data types specify the type of memory data that is used by elements and functions in your program.

Note that some of these are not implemented in the current version.

General Data Types

Operand

Bit Length

Format (units)

Range

Bit

1

Boolean

ON/OFF

INT8 (Byte)

8, signed

Decimal, Hexadecimal,

FF

UINT8

8, unsigned

Decimal, Hexadecimal,

-128 to +127

INT16

16, signed

Decimal, Hexadecimal,

-32768 to +32767

UINT16 (Word )

16, unsigned

Decimal, Hexadecimal

65535, FFFF, 255 & 255

DINT

32, signed

Decimal, Hexadecimal,

-2,147,483,648 to +2,147,483,647

UINT32 (DW)

32, unsigned

Decimal, Hexadecimal,

0- 4,294,967,295

REAL (float)

32

Floating point

Negative values -3.402E37 to -1.176E-35

Positive values: +1.176E-35 to +3.402E37
Note that if you perform calculations for example, DIV, with REAL and Constant values, you must include a decimal point in the constant value, for example #12.0.

Time and Date

Each RTC function is serviced by a struct, which supplies operands for:

  • Date, including Day of Week, Day of Month, Month, and Year

  • Time, including Seconds, Minutes, and Hours

Strings

User-defined

  • ASCII (Unicode)

  • UTF-16

  • UTF-32

Constant

Either:

  • A numeric value entered into a Data Tag Field, by typing a number and pressing Enter.

  • A String value entered into a Data Tag Field, by typing characters in between quotation marks and pressing Enter.
    This method can also be used for entering a constant in an HMI property.



    When a numeric or string constant is a legal value, it is prefixed with a pound sign, for example #"password" or #5.
    Note that this method

  • A Named Constant, where when a Data Tag name is assigned, the Constant option is checked, and a Power-up Value serves as the constant value.

 

Alias Const

A named user-defined constant value of any length that may be used at any point in the program.

Timer

32

Each Timer is serviced by a Data Tag Struct containing the Preset Value, the Current Value, and the Timer Done Bit.

 

User-defined Data Structures

Arrays

The user may include operands of the same data type which may be handled as a sequential block of data.

Structs

The user may mix other operand types, or arrays of operands, into a structure, which may be handled as a sequential block of data.

User-defined Structs are organized under the Structs tab in the Data Tag window.

Buffers

A buffer is an array of bytes. The user can define the length of the buffer.

 

System-created Data Structures

Structs

Structs are created automatically by UniLogic when you add certain elements to the application. Examples include:

  • Hardware Configuration: UniLogic creates Structs to service I/Os. To view them, click the I/O tab of the Data Tag window.

  • Timers: each time you create a Timer, UniLogic creates a Struct. These are organized under the General tab in the Data Tag window.

  • PID: when you configure PID, UniLogic creates a Struct. These are also organized under the General tab in the Data Tag window.

Buffers

Buffers are also created automatically by UniLogic when you add certain elements to the application.

For example, when you include a PID Autotune function in your application, a Buffer is automatically created to store the Autotune parameters.

 

Related Topics

Tags (Operands)

Creating User-defined Data Tags

Structs