ML1100 -Min to Hrs, Min, & seconds

skyfox

Lifetime Supporting Member
Join Date
Nov 2006
Location
CA
Posts
279
Working with a Micrologix 1100 and trying to figure out how to get Hours, min and seconds from an integer minute value.

For example, 1230 minutes.

I want to convert it to Integer A= Hours B= Minutes C = Seconds.

I do not see a MOD instruction. How do I go about this?

Thanks
 
Firstly, if it's an integer register holding minutes then your seconds will always be zero.

I'm sure there is a way to do modulo on the 1100 but I'm nowhere near rslogix to look. You can just do a divide by 60 to get hours using an integer destination. Then multiply by 60 again and subtract from the minute register to get the remaining minutes. I think that should work but can't test it right now :)
 
To perform modulo division on a Micrologix make the destination address be the math register, word S:13.

After the division, the quotient will be in S:14 and the remainder will be in S:13. Before doing any other math, you should use move the results right away as doing additional math may change the contents of the math register.

1230 minutes is 20 hours and 30 minutes. Lets minutes are in in N7:0

DIV N7:0 60 S:13
MOV S:13 N7:2
MOV S:14 N7:1


Now the hours are in N7:1 and the minutes are in N7:2

If you have a tech connect contract you can download an example program from tech note 17897

tc061715a.JPG
 
Last edited:
Thanks TConnolly & Saffa,

That is exactly what I was looking for. I do have a Tech-connect Contract. Thanks for the Tech-note ID as well.

Cheers!
 

Similar Topics

I'm looking to implement a low-cost, efficient method of communicating some integer values to an R30iB robot from a Rockwell 1100 PLC. I am not...
Replies
8
Views
1,723
Hello all, I am trying to setup my MicroLogix 1100 as a modbus RTU master for a modbus network containing multiple modbus RTU slaves. I currently...
Replies
7
Views
3,916
We have a machine that keeps losing its program at random intervals; sometimes 2x-3x in a shift, sometimes will go over 1wk without issue. I had a...
Replies
9
Views
2,929
Just asking for clarification here, but from my research all I need is a 500 ohm resistor across the AI and the common? Heres my schematic. I...
Replies
5
Views
2,576
I have a CLX L61 and I'm trying to read from and write to a Micrologix 1100. I'm attempting to read 200 REAL elements but I'm receiving an error...
Replies
2
Views
1,458
Back
Top Bottom