Date, Time, TimeSpan (amount of time): new tag data types in the Reliance SCADA/HMI system

January 2, 2014

Up to version 4.6.0, only the DateTime and Array of DateTime data types had been available in the Reliance system for working with dates and times. The Reliance SCADA/HMI system, version 4.6.1, extends its list of data types to include data types for working with dates and times. Additionally, the TimeSpan (amount of time) data type has been added.

Up to version 4.6.0, only the DateTime and Array of DateTime data types had been available in the Reliance system for working with dates and times. Tags of such data types are intended for storing a value with both parts – the date and the time. When displaying (entering) the value of such a tag, both the date and the time had been displayed (entered). This had led to certain limitations when creating visualization projects.

The Reliance SCADA/HMI system, version 4.6.1, extends its list of data types to include data types for working with dates and times. Additionally, the TimeSpan (amount of time) data type has been added. The following table shows the list of data types for working with dates and times.

Tag data types for working with dates and times in the Reliance system
Data type Description Version
Date date of the year 4.6.1
Time time of the day 4.6.1
DateTime date and time 4
TimeSpan (amount of time) elapsed time 4.6.1
Array of Date date of the year 4.6.1
Array of Time time of the day 4.6.1
Array of DateTime date and time 4
Array of TimeSpan (amount of time) elapsed time 4.6.1

Internally, all the data types for working with dates and times are based on the basic data type – DoubleFloat. The integer part of the number represents the number of days elapsed since December 30, 1899. The decimal part indicates the part of the day that has passed since midnight. The four basic arithmetic operations can be easily performed among individual tags. For example, in a script, you can add the value of a Date-type tag to the value of a Time-type tag and store the result in a tag of type DateTime without any loss of accuracy.

TimeSpan (amount of time)

TimeSpan (amount of time) is a new data type that can be used to store information about an elapsed time period or a time span.

TimeSpan

For example, the value in the picture (148:05:36.254) consists of 148 hours, 5 minutes, 36 seconds, and 254 milliseconds.A typical example of how to use the TimeSpan (amount of time) data type in practice is measuring the runtime of a machine. After reaching the prescribed limit, the application can notify you of the necessity to service the machine.

Display with millisecond precision

Reliance now allows you to display the values of tags of types Time, DateTime, and TimeSpan (amount of time) with millisecond precision. You can activate this property for each tag through the Device Manager's Advanced page.

Reliance, Device Manager, Time format

Device Manager > tag properties > Advanced

Import of data structures or tags from ST or XML in accordance with IEC 61131-3

The following table shows how the data type is determined when importing objects from formats in accordance with IEC 61131-3.

IEC EN 61131-3 data type Reliance data type
DATE Date
DATE_AND_TIME DateTime
TIME_OF_DAY Time
TIME TimeSpan (amount of time)

In older versions, the data type was determined according to the following table.

IEC EN 61131-3 data type Reliance data type
DATE Date
DATE_AND_TIME DateTime
TIME_OF_DAY LongInt
TIME LongInt

When importing to older projects, backward compatibility is maintained. For example, if a tag of type TIME is imported and there is already a same-named tag of type LongInt in the project (device) in the way it was previously imported, this tag will remain of the same type, i.e., LongInt. If there is no tag of the same name, a new tag of type TimeSpan (amount of time) is added.

Conversion of tag values in communication drivers

In most types of devices (e.g, PLCs), the values of tags of type date and time are stored in a different format than used in the Reliance system. If this format is uniquely determined by a device type or a communication protocol type, native communication drivers perform the conversion of the tag values. When reading a value, it is converted from a format dependent on the device to the Reliance format. When writing, the value is converted vice versa.

No conversion is performed, for example, for Modbus devices because this protocol is very general and does not define the way tags of type date and time should be stored.

Bulb, icon

Tip:

Haven't found what you were looking for? Use this form to inform us about it.

Related links


Example projects

Video tutorials

Frequently asked questions

Reliance training courses

Try the Reliance SCADA system right now!

Try the Reliance SCADA/HMI system on several sample visualizations.

Try the Reliance SCADA/HMI system on several sample visualizations or download the trial version installer to your computer for free.

Try the Reliance SCADA system right now Try the Reliance SCADA system right now Try the Reliance SCADA system right now