Deke Posted April 5, 2011 Report Share Posted April 5, 2011 Hi All, Just wanted to share this, Using this formula; ( 1 + ( Y * 5 / 4 ) Y = SI-33 (Current Year Value from RTC) Results = MI-95 Than take the results and put them into the Modulo (%) function A = MI-95 B = D#7 C = MI-96 Now determining the Start Date in March, use the SUB function (14-MI96=MI97) A = D#14 B = MI-96 C = MI-97 answer = 13 do the same for the End Date in November, use the SUB function (7-MI96=MI98) A = D#7 B = MI-96 C = MI-98 answer = 6 Multiply MI-97 by 100 and then add 3 to get a value of 1303, March 13 is the DST start date for 2011 Multiply MI-98 by 100 and then add 11 to get a value of 611, November 6 is the DST end Date for 2001 Now that we know the dates we can add in the other data and then create a UTC of the start and end dates using the store function add the other known values; MI-100 RTC Seconds SS (0) is 00 seconds MI-101 RTC Hour and Minutes HHMM (200) is 2:00am MI-102 RTC Day and Month DDMM (1303) is 13th of March (MI-97) MI-103 RTC Year (2011) is current Year MI-104 RTC DOW (1) is Sunday Do the same for the End Date MI-110 RTC Seconds SS (0) is 00 seconds MI-111 RTC Hour and Minutes HHMM (200) is 2:00am MI-112 RTC Day and Month DDMM (611) is 6th of November (MI-98) MI-113 RTC Year (2011) is current Year MI-114 RTC DOW (1) is Sunday Then use the RTC to UTC function, MI-100 to DW-1 value for 2011, 13th of March @ 2:00am on Sunday should be 3508970400 MI-110 to DW-2 value for 2011, 6th of November @ 2:00am on Sunday should be 3529533600 Now we just need to see if the current RTC in SI-30 to UTC once every hour is in or out of the above range and set or reset bits or better yet save to a data table a bit for DST status. If you need an example, let know, I'll see if I can attach one after deleting other attachments so that I can, as I think I'm at my 500K global upload limit. Deke Quote Link to comment Share on other sites More sharing options...
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.