Converting seconds to minutes and seconds in logix 500

daleward

Member
Join Date
Jan 2006
Location
fullerton
Posts
2
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
 
Last edited:
Calculating mintues and seconds from a seconds timer seems relatively straight forward, all you have to do is divide the seconds by 60. But in the SLC, integer division using the DIV instruction rounds the result, so anything past a half a minute rounds upwards. What you need is to perform a division operation that will give you the quotient and remainder as seperate numbers. Fortunately, the SLC has just such an instruction: The DDV instruction for 32 bit division.

Use the DDV instruction to divide the timer.ACC by 60. The seconds and minutes will then be in the math register at S:13 and S:14.

See the attached PDF file.
 
Last edited:

Similar Topics

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...
Replies
3
Views
4,240
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
205
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
120
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
314
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
387
Back
Top Bottom