adccommunitymod (AutomationDirect) asked a question.

Setting Click Clock From Program

Created Date: August 21,2013

Created By: northwind

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Hi, I fear I may have mad a grave error in my selection of a PLC. I have experience in the past using DL06s and the TIME function to set the time/date via a HMI. Works great. I have just built a rather large lighting control system around a CLICK with RTC and a Cmore Micro. Controlling lighting by time of day works fine, but the last task I had was to design the user interface to set the time. I think I'm in trouble as it appears there is no way to do it. Am I missing something? A service call twice a year to update the time is not an option. Thanks.


  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: bcarlton

    Until they change the firmware be prepared for two visits a year. Or else a different PLC which may only take one visit. Your choice. But of course they'll probably update the Click to that capability the day after you install a replacement.

  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: BobO

    Probably overkill, but Do-more has a very extensive time management system including instructions to set the time from an SNTP server or from an HMI, as well as the ability to adjust time zone and DST from the PLC's image register.

  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: northwind

    Thanks, but I do not require automatic correction for DST. It would be acceptable for the customer to adjust the time via the HMI twice a year. My problem is, I cant see any way to adjust the time from ladder. The RTC registers appear to be read only and I cant find any documentation of a built in function (similar to "TIME " in a DL06) to allow setting the RTC.

    A RTC with no way to adjust from ladder is useless in my opinion. Maybe it would have limited merit for in-house equipment where maintenance could adjust the clock via software, but absolutely worthless for equipment destined for a customer.

    I hope I'm just missing something here or I'm in for a big re-wire.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: bcarlton

    To repeat, kind of, there is no way from a ladder program to alter the RTC in the Click. They don't seem to highlight that 'feature ' in the description. Switch to another or hold your breath. It took them several years to introduce analog add-on modules. Maybe after another decade they'll have time setting commands.

  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: AlbertL

    Thanks, but I do not require automatic correction for DST. It would be acceptable for the customer to adjust the time via the HMI twice a year. My problem is, I cant see any way to adjust the time from ladder. The RTC registers appear to be read only and I cant find any documentation of a built in function (similar to "TIME " in a DL06) to allow setting the RTC.

    A RTC with no way to adjust from ladder is useless in my opinion. Maybe it would have limited merit for in-house equipment where maintenance could adjust the clock via software, but absolutely worthless for equipment destined for a customer.

    I hope I'm just missing something here or I'm in for a big re-wire.

    My post was just an example of the basic principle I'm suggesting: to create a "virtual " RTC by means of a subroutine or timed-interrupt routine which will add/subtract user-specified adjustment values (in your case, entered via the HMI) to the "real " RTC value, and return the corrected date/time in designated memory addresses. Your program would use those addresses instead of the original RTC addresses.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: northwind

    My post was just an example of the basic principle I'm suggesting: to create a "virtual " RTC by means of a subroutine or timed-interrupt routine which will add/subtract user-specified adjustment values (in your case, entered via the HMI) to the "real " RTC value, and return the corrected date/time in designated memory addresses. Your program would use those addresses instead of the original RTC addresses.

    Ahh, I see now. Good idea for dealing with DST. Unfortunately, that wont help with correcting the base time if it drifts. Thanks.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: northwind

    To repeat, kind of, there is no way from a ladder program to alter the RTC in the Click. They don't seem to highlight that 'feature ' in the description. Switch to another or hold your breath. It took them several years to introduce analog add-on modules. Maybe after another decade they'll have time setting commands.

    Got it. Ordering a new plc right now as customer is not good at holding breath.

    Thanks AD, that's awesome :mad: . This REALLY needs to be an asterisk next to RTC in the click feature list. Not the end of the world except for the TWO DAYS I have into developing the ladder program for the click.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: AlbertL

    Ahh, I see now. Good idea for dealing with DST. Unfortunately, that wont help with correcting the base time if it drifts. Thanks.

    Actually I think the same concept would work for correcting the drift. You can't change the "real " RTC value, but you can create a corrected or "virtual " RTC value that is sync'd with it.

    Assuming the operator will be entering the correct time via the HMI, your program would compute the difference between the time he entered and the current value of the "real " RTC, and store that difference in the "correction " address. Then, each time your program needs the correct time, it would call a subroutine which reads "real " RTC, adds/subtracts the correction, and stores the result in designated addresses - the "virtual " RTC - which your program will read instead of the "real " RTC addresses.

    As an alternative to the subroutine, you could use a timed interrupt to periodically update the "virtual " RTC addresses, so they'll always be correct.

    As Bernie noted in the other thread, the correction program would have to account for day/month/year rollover. The worst case would be changing the time. for example, 11:59 PM on Dec. 31 to 12:01 AM on Jan. 1, when the day of week, month and year would all change.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: August 21,2013

    Created by: northwind

    Actually I think the same concept would work for correcting the drift. You can't change the "real " RTC value, but you can create a corrected or "virtual " RTC value that is sync'd with it.

    Thanks, I can see how that might work, but way too much of a kludge for me. I'll call this a learning experience and order the appropriate hardware. Probably going to go with a Do-More. It's driving a tack with a sledgehammer, but whatever.

    Expand Post
10 of 16