Jump to content

update time with daylight savings


Recommended Posts

  • MVP 2023

I made a daylight savings time subroutine in the long ago.  Here's an export of it.

The PLC has to have power applied when Daylight Savings Time kicks over.  I always wanted to add sensing logic to see if it happened while it was off but never got around to it.  If anybody wants to improve on this please share your work as I have.

You can bring it into your project by right-clicking on "!Main Module" and selecting Import Subroutines.  It uses MB 190 and MB 191.  Then call it all the time from the Main Routine.

Joe T.

Daylight Savings Time.vlx

Link to comment
Share on other sites

I use a subroutine that also works when PLC was powered down during Daylight saving time, allthough it is not perfect. When PLC was powered down during change of daylight saving time then the correction may be delayed up one week (but at least correction will be done at all).

You will find the subroutine attached, but please keep in mind that I am living in Europe so different rules for start and end of daylight saving times may occur on your site, Feel free to adopt the data in line 1 and line 2 to your demands.

DST.vlx

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.