Micrologix 1100 - How to mplement this PLC-5 rung?

Thanks for the Replies all.

Daba, This routine is in the main rung. It's just a simple test routine and the logic is being scanned as every thing below it updates. Also if I change the RTC bit from 0 to Bit 1, counter starts counting up.

Alaric, I have posted my simple test routine. Please change the >TXT extension to .RSS.

Thanks again for all the help.
 
I'm at a loss on this one - except to say that the RTC values are coming from the COMPUTER not the controller, so will be subject to RSLinx update time.

However, you said that S:42 (the controller's SECONDS) exhibits the same problem, which really has me stumped, as that is supposed to be a proper Real-Time clock.

Can you try your test again with S:42/0 instead of RTC:0.SEC/0 ?
 
Hi daba,

It does not like individual S:42 (RTC seconds Bits).
Look at the error below. It say's Two rungs. But I only have one rung in the program. I am guessing RTC S:42/xx register only accesible as a word and not at bit levels. Because rest of the bits generate the same failure. RTC is in the mocrologix as it's updating my HMI's time even without an RSLinx connection (Via Kepware's OPC). I am stumped as well!
ML1100.JPG
 
o_O o_O o_O


Try this:

A062508209AD.JPG


This has got me wondering if the RTC:0.SEC element is not a unique word but if its part of a packed a bit field, so that although the /0 seems to be addressable, its not the right bit. You need to use the CPW instruction instead of the MOV instruction to copy RTC elements to N elements.


edit: OK, After looking at the help file on the CPW instruction I'm more convinced that the RTC elements are part of a packed bit field and do not necessarily obey word boundaries, hence while RTC:0.SEC/0 may compile just fine, it is probably not a meaningful address.
You may reference a sub-element of bits in a function file containing a combination of RO and RW bits as the source and destination operands. For example HSC:0.2 (This entire word is comprised of various meaningful bits).
The controller enforces the access (RO, RW) to bits, words and double words of a function file in the destination operands and for all words processed during the instruction as determined by the length operand.
 
Last edited:
Hi Alaric,

Thanks again for your help. It still updates every two seconds. Please see the logic below. I cleared all of the Data File & Counter registers during the first scan before starting this test.

Thanks again to all of you.


ML1100A.JPG
 
I hooked up an unused ML1100 and sure enough, the RTC counts by twos. It looks like Rockwell once again did something silly with one of their bricks.

Skyfox, at this point your options with the RTC are somewhat limited. What is it you are trying to do anyways that you need to use the RTC? Why won't a normal timer work for you? Are you trying to accurately time very long time periods without accumulating scan time errors? If so then I have several posts on the topic.
 
Last edited:
This from the RAKB

posted in the knowledgebase against the ML1200 and 1500, but I guess applies to at least 1100 as well.


The Real Time Clock (RTC) increments by 2 seconds all of the time. The RTC never shows odd seconds.
This is the way the RTC is supposed to work.
If exact time is needed in an application, it is suggested that the free running clock at S:4 be used.



Summary: RTC seconds incrementing by 2's
Catalog Number: 1762MM1RTC;1762RTC;1764MM1RTC;1764MM2RTC;1764RTC
DocFullNum: G21143
Revision:
Fixed in Revision:
Package:
Modual:
 
This ought to work...

Paste in the following rungs

XIC RTC:0.SEC/1 BST TON T4:0 0.01 100 0 NXB XIO T4:0/DN OSR B3:0/1 B3:0/2 NXB XIC T4:0/DN OSR B3:0/3 B3:0/4 BND

XIO RTC:0.SEC/1 BST TON T4:1 0.01 100 0 NXB XIO T4:1/DN OSR B3:0/5 B3:0/6 NXB XIC T4:1/DN OSR B3:0/7 B3:0/8 BND

BST XIC B3:0/2 NXB XIC B3:0/4 NXB XIC B3:0/6 NXB XIC B3:0/8 BND OTE B3:0/0

See the attached file - change its extension to .RSS

(I posted a BAK file - it doesn't matter its the same)
 
Hi Daba,

Very clever. I suppose this is much more accurate than using a .0001 interval timer w/a 1000 preset.

Thanks for all the help.

Cheers!
 
I hadn't considered absolute accuracy w.r.t. which timebase to use. Either would be fine, just change the preset to suit the timebase giving each timer a 1 second time.

My solution may produce alternate 1 sec pulses that are "less" accurate, but since the XIO Timer.DN bits are driven from the PLC clock, you will not get any cumulative error.
It all depends on how perfectly symmetrical you need the 1 sec. pulses. Remember you are always going to be a slave to the PLC scan time, and as such I believe the solution is as good as you're going to get, without interrupt routine processing.
 
I've covered methods for making various timing signals that do not have the problem of accumulating scan time errors in several past posts and covered the inner workings of timers. The trick is to properly manage the least significant byte of the T4:X.0 word where the time reference is stored. I mentioned it in Post 14 above but didn't to into detail about how it avoids the problem of totalizing scan times into the elapsed time.

Its important to remember that a timer is nothing more than a series of computer instructions that operate on a memory location in the PLC. I coverd the inner workings of the timer in some detail here: http://forums.mrplc.com/index.php?showtopic=11983&st=0&p=58273&#entry58273


Other threads where its been discussed:
http://www.plctalk.net/qanda/showthread.php?t=29287
http://www.plctalk.net/qanda/showpost.php?p=183865&postcount=2
 
Last edited:
Guaranteed Working Solution

All the Micrologix PLCs are equiped with a S:4 register, which will give exactly 10000 counts per second.

Using the following logic, you will produce a perfectly accurate one second pulse.

GEQ S:4 10000 BST OTE B3/0 NXB SUB S:4 10000 S:4 BND



This works for all Micrologix, even without the RTC.

Simple :cool:
 
perfectly accurate one second pulse

Well - the time between actuations will be variable based on scan but the longer term accuracy will be correct. The bit will be triggered on the first scan where the ACC >= 10000. The subtraction will cause the next evaluation to be a little earlier (based on the accumulator). This would continue until the previous true evaluation happened just after the accumulator reached 10000. The next would probably be delayed 1 scan. You'd probably see the actual number of scans between actuations vary +- 1.
 

Similar Topics

Hi, I cannot find the DLCA1764.EXE utilty software for data retrieving. Can someone share the link to download this software. Thanks!
Replies
4
Views
124
I am currently backing a Micro Logix 1100 and no-one seems to have the file for me to upload from. Is there a way for me to upload the project off...
Replies
15
Views
523
I am trying to set up a read message in a MicroLogix1100 to read the value of a DINT in a ControlLogix5561. I have successfully set up a message...
Replies
2
Views
192
Hello, I have an existing application that has a Powerflex 700 with a 20-COMM-E adapter controlled by a Micrologix 1100 via Ethernet. The setup...
Replies
6
Views
1,193
I have a MicroLogix 1100 and it's capable of ac or dc output voltages. What I don't know is how I'm supposed to tell the 1100 to use dc for the...
Replies
13
Views
1,407
Back
Top Bottom