converting seconds to (min:sec) in rslogix5000

Join Date
Apr 2015
Location
Dayton
Posts
7
I need to take seconds and convert to mm:ss. Say i have a cycle that the operator of a machine wants to run for 125 seconds. He will enter 125 into a setpoint on the hmi. They want me to show them on the hmi how much time is left in that cycle while its running. Its simple for me to do if i show them in seconds. But how do I convert those seconds to be displayed
as mm:ss (02:05)????

Math wise: 125/60=2.083 (This gives me minutes)
.08333333*60=4.999 (This gives me seconds)

Im trying to display a reg for minutes then next to it a reg for sec. But I cant figure out how to take my 2.083 and mask it so I get rid of the 2 so that i can do my seconds equation. Is there another way to do this or am i on the right path? can you mask real #s?
 
Do a MOD instruction

Or..get your minutes and discard the fractional part = minutes

total secs - (minutes*60) = seconds left
 
AB has an AOI in their sample code library that does mS to HHMMSS. Great for displaying time remaining in timers of any length.
 

Similar Topics

I need to display timer acc. in munites and seconds. without adding counters to track minutes. How do I do the math to show in minutes and seconds
Replies
2
Views
5,381
Hello everyone, can anyone help me with covert the STL code to ladder. Iam using plc s71200. A %DB1.DBX33.7 // angel of vaccum...
Replies
2
Views
210
Hello PLCs Forum, I am in a bit of a pickle and was hoping someone could offer me some help. I have a .rss file and just need to see the ladder...
Replies
2
Views
123
Hello nice to meet you, im new in here, I'm currently trying to convert code written in STL for a S7-400 to SCL for an S7-1500, because when i run...
Replies
5
Views
320
Hello, did anybody know, if there exist an converting cable like the1492-CM1746-M01 (for an 1746-IB16 to an 5069-IB16), for an 1746-HSCE to an...
Replies
3
Views
391
Back
Top Bottom