adccommunitymod (AutomationDirect) asked a question.

Click PLC Hr:Min:Sec Format

Created Date: February 05,2015

Created By: Gripped

**** 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.****

I have been wrestling with a straight forward way to create an HMI display countdown timer in the Hr:Min:Sec format from a timer with the Click PLC. Appreciate any advice.


  • adccommunitymod (AutomationDirect)

    Created Date: February 05,2015

    Created by: bcarlton

    Use a standard timer with a 'seconds ' timebase.

    Subtract the current value from the setpoint to get the remaining time in seconds.

    Then use math blocks with divisions and MODS to seperate out the hours and minutes and left over seconds.

    That may not be 'straight forward ' but it is kind of what you need to do.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: February 06,2015

    Created by: Gripped

    @bcarlton

    Does this look right?

    DS1-TD1 = DS2

    DS2 MOD 60 = DS3 Seconds

    ((DS2-DS3)/60) MOD 60 = DS4 Minutes

    (DS2/3600) MOD 100 = DS5 Hours

  • adccommunitymod (AutomationDirect)

    Created Date: February 06,2015

    Created by: bcarlton

    That looks about right.

  • adccommunitymod (AutomationDirect)

    Created Date: February 06,2015

    Created by: Gripped

    Excellent, appreciate the help.

  • adccommunitymod (AutomationDirect)

    Created Date: February 06,2015

    Created by: Gripped

    Ok so I 've now run into another hurdle, I need the time to be able to be able to have up to 24 hours stored in the setpoint variable. Since DS integer values can only be up to 32,767 that only gives me 9 hours in seconds. The timer does not accept double integer DD variables. Is there a way around this?

  • adccommunitymod (AutomationDirect)

    Created Date: February 09,2015

    Created by: Gripped

    @Tinker

    This works perfectly, thank you for the help and example. Great community advice.

  • adccommunitymod (AutomationDirect)

    Created Date: February 05,2015

    Created by: Gripped

    I have been wrestling with a straight forward way to create an HMI display countdown timer in the Hr:Min:Sec format from a timer with the Click PLC. Appreciate any advice.