
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.
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.
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
Created Date: February 06,2015
Created by: bcarlton
That looks about right.
Created Date: February 06,2015
Created by: Gripped
Excellent, appreciate the help.
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?
Created Date: February 06,2015
Created by: Tinker
A counter uses 32 bit integers, try a counter triggered by SC7. With a counter one also has the count down option, which sounds like what you want anyway.
Edit: here is an example:
http://forum.automationdirect.com/attachment.php?attachmentid=1656&stc=1&d=1423274968
Created Date: February 09,2015
Created by: Gripped
@Tinker
This works perfectly, thank you for the help and example. Great community advice.
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.