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.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...