PDA

View Full Version : Using the Real Time Clock in Micrologix 1400


gbradley
May 4th, 2012, 04:02 PM
OK let me first explain how I am doing something and then you can tell me how I can do it better.
I move the current day, Month, Hour and Minute into a register
MOV RTC:0.DAY L9:6
MOV RTC:0.MON L9:7
MOV RTC:0.HR L9:8
MOV RTC:0.MIN L9:9
I move the current count to another register
MOV L9:0 L9:10

I want the HMI to show the last 20 Resets, so that it will look like
07 May 13:27 8,356
04 May 22:13 7,301
04 May 17:27 8,806
etc...
Where the data values are:
Day Month Hour Minute
http://www.plctalk.net/qanda/attachment.php?attachmentid=22234&stc=1&d=1336165327

This requires 4 numeric displays in the HMI for the date
Or is there one numeric value in the RTC that you can you can give to the HMI?
Sort of like in Excel where 41037 = 5/8/2012

Eric Nelson
May 4th, 2012, 08:29 PM
I don't know if there's a 'one numeric value' location, but as far as populating your L registers...

Instead of MOV, I would think you can just use a copy (CPW), starting at RTC:0.YR, with a length of 4, to transfer the current date and time to L9:6 thru L9:9.

Haven't tried it, so I may be wrong... :huh:

:beerchug:

-Eric

gbradley
May 4th, 2012, 09:10 PM
I don't know if there's a 'one numeric value' location, but as far as populating your L registers...

Instead of MOV, I would think you can just use a copy (CPW), starting at RTC:0.YR, with a length of 4, to transfer the current date and time to L9:6 thru L9:9.

Haven't tried it, so I may be wrong... :huh:

:beerchug:

-Eric
That's what I'm talking about, I'll try that Copy on Monday, no Tuesday.
I'm going to the Beach on Monday. :beerchug:

iant
May 4th, 2012, 09:15 PM
Old Age Sickie?

Mickey
May 4th, 2012, 09:21 PM
I'm going to the Beach on Monday. :beerchug:

Nice!! I was done your way ( Norco) this morning, with an overcast the sweet smell
of dairy farms was a little strong for this desert rat.

ESL was my favorite panel builder when I did that sort of thing. If you use them say hello to Carol for me.