Data types

Previous chapterNext chapter Show allShow all    Hide allHide all

Each variable is based on an IEC data type. The data type consists of the same properties as the variable itself (unit, signal resolution, limit, etc.) with the exception of the driver-specific properties as e.g. the addresses in the PLC. A data type is a variable template without connection to the process. This connection to the process is established with the driver object type for the variable.

On creating a new variable a data type has to be selected. All properties of the data type are inherited to the variable. A reference to the properties of the data type is established, i.e. if a property of the data type is changed, it is also changed in all variables linked to that data type.

If a property is a reference, it is marked with a symbol in the properties window.

This reference can also be cut. A more detailled description can be found in the chapter inheritance concept.

IEC datatypes:

IEC data types are normed in the IEC 61131-3 by the IEC. At the the moment zenon supports the following IEC data types:

Short name

Long name

Comment / value range

Number of bits

BOOL

Boolean

Bit: 0/1

1

BYTE

 

 

 

SINT

Short integer

Signed byte:

-128 to 127

8

USINT

Unsigned short integer

Byte: 0 to 255

8

INT

integer

Signed word:

-32768 to 32767

16

UINT

Unsigned integer

Word: 0 to 65535

16

DINT

Double integer

Signed double:

-2147483648 to 2147483647

32

UDINT

Unsigned double integer

Double:

0 to 4294967295

32

LINT

Long Integer

Because zenon cannot hold the value range of a 64 bit number, the actual value range is restricted to 52 bits. Numbers with signs are possible from –2251799813685248 to 2251799813685247. Numbers outside of this range cause a overflow or underflow, according to a 52-bit integer.

The following components work with a full 64 bit resolution in the zenon Runtime:

  1. The shared memory VBA Interface, when the value was entered in signal resolution.
  2. The shared memory straton interface.
  3. The driver kit works for the whole range of 64 bits, and so do all the drivers, provided the driver supports this data type. At the moment, these are Sample32, Internal and STRATON32.

RGM and recipes cannot save even a 52 bit value with full accuracy.

64 resp. 52

ULINT

Unsigned long integer

Because zenon cannot hold the value range of a 64 bit number, the actual value range is restricted to 52 bits. Numbers without signs are possible from 0 to 4503599627370496. Numbers outside of this range cause a overflow or underflow, according to a 52-bit integer.

The following components work with a full 64 bit resolution in the zenon Runtime:

  1. The shared memory VBA Interface, when the value was entered in signal resolution.
  2. The shared memory straton interface.
  3. The driver kit works for the whole range of 64 bits, and so do all the drivers, provided the driver supports this data type. At the moment, these are Sample32, Internal and STRATON32.

RGM and recipes cannot save even a 52 bit value with full accuracy.

64 resp. 52

REAL

Real numbers

Real numbers

32

LREAL

Real numbers

Real numbers

64

STRING

Variable-length single byte character string

ASCII string (the max. string length depends on the driver). The string length is set to 5 as a default. If needed the length has to be changed.

 

Refer to the chapter Inheritance concept for the detailed description of the inheritance of data type properties.