GenTime Data Type

<< Click to Display Table of Contents >>

 

GenTime Data Type

GenTime is a date and time data type originally defined and added to this Driver for use with Elipse Software's Generic SOE Reading Algorithm. It is, however, a generic data type that can be easily used with almost any PLC.

In an application, that is, in values of Tags and Block Tag Elements, as well as in Tag's Timestamp field, this data type, as well as all other date and time data types of this Driver, is represented by an application's native date and time data type. For more information about other date and time data types supported by this Driver, please check topic Supported Data Types. For more information about application's date and time data types, please check their respective user's manual, because there are some differences between VBScript used in Elipse SCADA and VBScript used in E3 and Elipse Power.

In the PLC or slave device, this data type is represented by a structure composed by four 16-bit registers, or eight bytes, as displayed on the next table.

Structure of registers

Offset

Content

Bit Mapping (16 Bits)

Range (Decimal)

0

Year

AAAAAAAA AAAAAAAA

Between 0 and 65535

1

Day and Month

DDDDDDDD MMMMMMMM

Between 0 and 65535

2

Hour and Minute

HHHHHHHH MMMMMMMM

Between 0 and 65535

3

Second and Millisecond

SSSSSSMM MMMMMMMM

Between 0 and 65535

 

The base address, offset 0 (zero), for attribution on Tag's N4/B4 parameter accessing data, contains the year. The next register, offset 1 (one), contains the day as the most significant byte and the month as the least significant byte. The offset 2 (two) contains the hour represented in the most significant byte and the minutes in the least significant byte. The fourth register contains the four most significant bits of the Word representing seconds, and the remaining bits, the two least significant of the most significant and the integer's least significant byte, representing milliseconds.

Notice that each Tag referencing this data type forces this Driver to read a block of four Modbus registers in a device to represent the value of each Tag or Block Element to return a valid value.

Advantages of this data type are its simplicity, because it is easily generated in a PLC ladder, its milliseconds precision, and its relative compression, as it does not need native support by the PLC or slave device.

 

NOTE

Although the GenTime data type itself is an eight-byte size, or four Words, the only effective swap option is Swap Bytes. This happens because, as already explained on this topic, this data type is structured in the PLC memory as having four Words, and it is not a device's native data type, rather a Driver's data type. More information about swap options (byte order) can be found on topic Operations Tab.

Was this page useful?