Adjusting for daylight saving time in Do-More PLC.
When does it start and end?
Canada Daylight Saving Time begins at 2:00 am local time on the second Sunday in March. On the first Sunday in November areas on Daylight Saving Time return to Standard Time at 2:00 am local time. When Daylight Saving Time begins, turn your clocks ahead one hour. This is what happens in most parts of Canada.
There are several methods in the Do-More PLC to account for Daylight Savings Time. You can use the internet time clock, manual adjustment or use an internal bit to set daylight savings time. Since websites for internet time may not always be reliable and we do not want to wake up at 2 am in the morning to set the real-time clock, we will use the internal bit method.
ST768 $SummerTime Configuration
Set this bit ON to add one hour to LocalTime to account for Daylight Savings Time.
The first line of code will check for the 3rd month (March). Then ensure that the day is between 8 and 14 so that we are viewing the second week. Next, make sure the day of the week is 0 (Sunday). Finally, it will check to make sure the hour is 2 (2 am). The ST768 $SummerTime will then be turned on to add one hour to the real-time clock in the PLC.
The second line of code will check for the 11th month (November). Then ensure that the day is less than 8 first week. Next, make sure the day of the week is 0 (Sunday). Finally, it will check to make sure the hour is 2 (2 am). The ST768 $SummerTime will then be turned off to subtract one hour to the real-time clock in the PLC.
Adding this code to your existing logging information in the PLC can be helpful when determining the correct time.
If you have any questions or need further information, please contact me.
P.S. In the contact section, send me an email and I will send you a link for the download of this code.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.