Posted 11 Mar 2016 Hi Guys, Hoping someone can help me out. I have a time variable, which stores the elapsed time of a timer. I want to convert this to HH:MI:SS format so I can display on a LCD panel. Couldn't find an easy way to do this. Thanks in advance, Ben. Share this post Link to post Share on other sites
Posted 10 May 2016 use the [any to Dint] and save that to a variable to use for holding the time in a dint then it should give you time in ms i believe, so divide by 1000 and you have seconds, divide by 60 and you got minutes and if it is in the hours then divide by another 60 to get hours. just make sure the time value is not larger then a DINT can hold I guess or it will be a roll over and error or wrap the value around either is bad. then for a display of seconds remainging take the seconds variable and subtract ((hours * 3600) + (minutes * 60) and the result is the left over seconds because your taking off the seconds worth of minutes and hours from the total seconds value giving you the remainder. hopefuly this is enough to get you going. Share this post Link to post Share on other sites
Posted 11 May 2016 there is a RA example of this on the examples webpage for CCW at their webpage. Share this post Link to post Share on other sites
Posted 12 May 2016 http://search.rockwellautomation.com/search?client=samplecode&oe=UTF-8&ie=UTF-8&output=xml_no_dtd&proxystylesheet=samplecode&site=sample_code&getfields=*&lang=en&hl=en&sort=date:D:L:d1&wc=200&wc_mc=1&ud=1&filter=0&q=time micro800 https://www.youtube.com/watch?v=DM7XsJG3x7w Share this post Link to post Share on other sites