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,381
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,319
Hi Everyone. Not posted on here for a long time, but I am hoping someone can help me. I am doing a differential pressure calculation in a L27ERM...
Replies
15
Views
204
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
116
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
119
Back
Top Bottom