Studio 5000 - decimal time to min/secs

NJC123

Member
Join Date
Aug 2009
Location
various
Posts
38
Hello, I’m sure there is a simple way to do this but I can’t think of it. Any help would be great.
The problem is I’m trying to convert a decimal value to minutes and seconds to display on a HMI. The decimal value is a count down until the machine stops, this is worked out by
Timer.PRE- Timer.ACC)/1000 = seconds remaining
I’ve split this into minutes and second but both have a decimal point which causes problems when displaying it on the HMI.
e.g. 91sec/60 = 1.51min
If I don’t display the decimal point on the HMI it shows 2min.
Is there any way to remove the decimal point?
Thanks for the help.

PLC software: Rockwell Studio 5000
HMI: FactoryTalk
 
That method of rounding will only mean that the display would stay on the previous minute for one second longer than normal or jump to the next minute one second before normal. I don't think it will cause any great problem as just a readout.
 
You could Use MOD instruction to get the remainding seconds.
91/60 = 1 (minute) 91(mod)60= 31 (seconds). Then you could convert to strings with DTOS and CONCAT to display 1:31
 
One more thing if you decide to CONCAT into string. Use if <10 on Seconds then CONCAT a 0 and Seconds to show 1:09 and not 1:9
 

Similar Topics

I am trying to convert hex values to decimal. I am reading in values from 232ASC module. They come in on ___:4:I: Data[0] & ___:4:I: Data[1]...
Replies
8
Views
3,447
I am working on calculating a checksum value for a command that is to be sent from an Allen-Bradley CompactLogix PLC to a Mass flow controller...
Replies
2
Views
4,347
Hello everyone, I'm new here, I hope someone can help me. I've been trying to install EDS files to my Studio 5000 with the EDS tool installer but...
Replies
3
Views
86
Hi Everyone, I am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
4
Views
163
I am connecting to a remote device. When attempting to upload I receive an error that states: Error: Auto_Functions: The Import was aborted due...
Replies
3
Views
175
Back
Top Bottom