January 2, 2014 | Reliance SCADA
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) is a new data type that can be used to store information about an elapsed time period or a time span.
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.
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.
Data Table Manager > tag properties > Advanced
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 |
DateTime |
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.
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.