Convert RTO .ACC (milliseconds to HH:MM:SS)

I still can't find the sample AOI

edit;; I did find it, but it still does not put it into STRING format like I was hoping

edit2;; nifty, there is a DTOS instruction.. wow, why does it have to be this easy?
 
Last edited:
I would use 1 timer and 4 counters
Ms timer
Seconds counter
Minutes counter
Hours counter
Days Counter
The timer has a preset of 1000 ms
The seconds counter has a preset of 60 sec
The minutes counter has a preset of 60 min
The hours counter has a preset of 24 hours
And a day counter could be added with a preset of 365 days
The .dn bit on the timer increments the seconds counter by 1 and resets the Timer
The .dn bit on the seconds counter increments the minutes counter by 1 and resets the seconds counter
The .dn bit on the minutes counter increments the hour counter by 1 and resets the minutes counter
And the .dn bit of the hours counter increments the days counter by 1 and resets the hour counter
You could read in the acc values of the timer and counter and display them or you could assemble then into a string data type to read them in
Keep in min if the power is lost to the plc all counters and timers will be reset to 0

Another option would be to use 1 timer with a very large preset and read it in and convert it in the hmi
As needed but the limit would be the 32 bit limit on the timer acc value.
Then you could just divide the value in seconds – minutes – hours to be displayed as needed
 
I would just use the seconds clock to increment a seconds variable, when it reaches 60, increment the mins variable, reset the seconds, cascade this to hours, days years if required, simple but effective.
If you really need ms on many systems timebases are in 10ms increments but the same applies, forget leading 0's, if displayed on an HMI then these give you an option of displaying leading 0's or not.
 

Similar Topics

Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
101
I have an application using an incremental encoder and then I convert it to degree (0-360) using calculation program. For a while, the calculation...
Replies
8
Views
338
Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,420
Hello, could someone kindly convert the attached RSP files that are currently used for SLC 5 PLC into PDF please
Replies
6
Views
544
I'm trying to convert an RS Logix 500 fille when I open the 500 file and try to "save as" a .slc file, it does not allow it. It says " SLC library...
Replies
7
Views
702
Back
Top Bottom