Node1 Member N Join Date Jul 2017 Location USA Posts 20 Mar 10, 2018 #1 How do you convert hours minutes seconds in a expression?
Steve Bailey Lifetime Supporting Member + Moderator Join Date Apr 2002 Location The boondocks of Western Massachusetts USA Posts 8,585 Mar 10, 2018 #2 Are you converting from hh:mm:ss to something else or from something else to hh:mm:ss? in either case, please define "something else".
Are you converting from hh:mm:ss to something else or from something else to hh:mm:ss? in either case, please define "something else".
Rob... Lifetime Supporting Member R Join Date Jul 2016 Location Manchester Posts 483 Mar 10, 2018 #3 What software are you using?
Node1 Member OP N Join Date Jul 2017 Location USA Posts 20 Mar 10, 2018 #4 Studio 5000 Seconds is from accum of a timer preset 60000 minute comes from the done of the timer hour comes from minute add grt than 59
Studio 5000 Seconds is from accum of a timer preset 60000 minute comes from the done of the timer hour comes from minute add grt than 59
Rob... Lifetime Supporting Member R Join Date Jul 2016 Location Manchester Posts 483 Mar 10, 2018 #6 How do you want the finished conversion? 3 dints? An array? Check this thread. We do need more information on what you're trying to achieve to help you. http://www.plctalk.net/qanda/showthread.php?t=67998
How do you want the finished conversion? 3 dints? An array? Check this thread. We do need more information on what you're trying to achieve to help you. http://www.plctalk.net/qanda/showthread.php?t=67998
Node1 Member OP N Join Date Jul 2017 Location USA Posts 20 Mar 10, 2018 #8 I added the 3rd int seconds int minute int hour int I want to combine all 3 into HH:MM:SS. Anyone done this before in Studio 5000
I added the 3rd int seconds int minute int hour int I want to combine all 3 into HH:MM:SS. Anyone done this before in Studio 5000
AustralIan Member A Join Date Jan 2013 Location Leipzig, Germany Posts 1,368 Mar 10, 2018 #9 Totalseconds_DINT = time.acc / 1000 Seconds = Totalseconds_DINT mod 60 Minutes = ((Totalseconds_DINT mod 3600) - seconds) / 60 Hours = ((Totalseconds_DINT - minutes *60 - seconds) / 3600
Totalseconds_DINT = time.acc / 1000 Seconds = Totalseconds_DINT mod 60 Minutes = ((Totalseconds_DINT mod 3600) - seconds) / 60 Hours = ((Totalseconds_DINT - minutes *60 - seconds) / 3600
janner_10 Lifetime Supporting Member J Join Date Dec 2014 Location Tewkesbury Posts 1,301 Mar 11, 2018 #10 I got an AOI to do just this from the Rockwell site: http://search.rockwellautomation.co...le_code&getfields=*&lang=en&hl=en&dnavs=H_M_S Just converts the results to a string or if it's to display on a HMI, just use all 3 tags separated by a colon. Last edited: Mar 11, 2018
I got an AOI to do just this from the Rockwell site: http://search.rockwellautomation.co...le_code&getfields=*&lang=en&hl=en&dnavs=H_M_S Just converts the results to a string or if it's to display on a HMI, just use all 3 tags separated by a colon.