Variable values of the data type DATE_AND_TIME are date and time literals. The range of values for DATE_AND_TIME values is from DT#2001-01-01-00:00:00– DT#2099-12-31-23:59:59.
Description |
Example |
Short prefix |
DT#2010-06-07-15:36:55 dt#2010-06-07-15:36:55 |
Long prefix |
DATE_AND_TIME#2010-06-07-15:36:55 date_and_time#2010-06-07-15:36:55 |
Internal representation |
Seconds after DT#2001-01-01-00:00:00 |
Advantages:
Can be used to set (SET_RTC_DT) or read (GET_RTC_DT) the PLC's real-time clock, for example:
Facilitates all kinds of calculations for date and time
Well suited for solar tracking applications
Sun's position, sunrise, sunset
Conversions between universal time and local time
Building automation
Holidays (e.g. Easter holidays), daylight saving time
Enables better integration and adaptation of POUs created with other manufacturers' IEC 61131-3 programming software, e.g. OSCAT (Open Source Community for Automation Technology)