AdvancedHMI Software

General Category => Open Discussion => Topic started by: martinav on May 07, 2021, 09:02:47 AM

Title: Clock/Timer object format HH:MM:SS
Post by: martinav on May 07, 2021, 09:02:47 AM
I would like to take a seconds counter and put it into HH:MM:SS format in my HMI.  I'm not seeing an object or format to do this.  I presume I will need to do the math in the PLC, then send over three bits??  MHR1:MHR2:MHR3 in essence?  I also think it will take a lot of trial and error placement, as label locations during run-time are way off from their placement in edit mode.
Title: Re: Clock/Timer object format HH:MM:SS
Post by: MajorFault on May 07, 2021, 11:39:00 AM
Did you try searching?  There is a ton of into on this:
https://stackoverflow.com/questions/8869065/program-to-convert-time-in-seconds-to-hhmmss-format
https://stackoverflow.com/questions/463642/what-is-the-best-way-to-convert-seconds-into-hourminutessecondsmilliseconds/41799528
https://www.vbforums.com/showthread.php?283695-better-way-to-convert-seconds-into-dd-hh-mm-ss

PLC example, pic attached.