RGLogix500 CU instruction does not increment

mallorz

Member
Join Date
Oct 2011
Location
W
Posts
61
I had a call from a customer today who had a Count Up instruction that wouldn't work. It was controlled by one momentary pushbutton. When the count-up .ACC bit equals one, a light comes on. When it equals two the counter resets.

I had him try a Count Down instruction and it worked. What gives?

He was using version 8.3 of Logix500, Micro 1200 PLC.

EDIT: I should add that I don't have my software activations yet or I would test it out myself.


---||------|Count Up|--
--| = | ----------( )--
--| = | --------(res)--

 
Last edited:
Could be any number of things...


A RES instruction resets the count to zero when it is true. If it is true it is resetting the count. Often this is visible as the counter will count to one, but reset to zero, never reaching two or higher.

I worry when you say ACC "bit". Generally, we don't use the bit(s) from the ACC since it is an accumulated VALUE, not just an On/Off. Exceptions of course, but generally. When reset, the ACC = 0. When it goes from false to true it will = 1. When it goes false and true again it will = 2. And so on.

Can you describe what you mean when you say
count-up .ACC bit equals one, a light comes on. When it equals zero the counter resets

What ACC bit are you referring to?

Did they change the CTU to a CTD and it worked, or did they add a new CTD?


OG
 
Last edited:
What ACC bit are you referring to?

Did they change the CTU to a CTD and it worked, or did they add a new CTD?

They just changed it to a CTD I believe so he had the addressing correct.

My saying 'bit' is just poor terminology. When the counter increments from 0 to 1 (false to true) the output light would come on. With another press of the button, and another transition from 1 to 2, the reset instruction would activate.

I'm more or less just curious as to why something like this would happen. He never saw the counter increment.
 
When the count-up .ACC bit equals one, a light comes on. When it equals zero the counter resets.

Something in the description doesn't sound right here, what is he trying to accomplish?

As others said, things to check

Is Ladder Being scanned? is the Counter address being used/reset somewhere else? What is the Preset value of the Counter?
 
So when they changed to a CTD, they saw it count from 0 to -1?

What bit are they using to trigger the Light? There are two primary choices:

CU - Count Up
DN - Done

And then what are they using for the RES reset?

OG
 
Something in the description doesn't sound right here, what is he trying to accomplish?

As others said, things to check

Is Ladder Being scanned? is the Counter address being used/reset somewhere else? What is the Preset value of the Counter?


Okay, I see what you guys are referring to...

When the count-up .ACC bit equals one, a light comes on. When it equals zero the counter resets.

I didn't mean to say 'equals zero'. Sorry, I'm tired!

He has 5 or 6 lights. Each light is controlled by one set of those three rungs (he has those repeated for each light). Not sure the extent of the application beyond that.

Ladder was being scanned, you could see the bars around the input instruction turn green only when the button was pressed. Preset was 0. He had the counters all with their own address (I'm assuming..) because as soon as he changed the instruction type it worked.

I would imagine there was something simple being missed. Nonetheless I guess the important thing is we got it to work. I plan to write a small program similar to the above and send it to him with it working, just to know that it can.
 
So when they changed to a CTD, they saw it count from 0 to -1?

What bit are they using to trigger the Light? There are two primary choices:

CU - Count Up
DN - Done

And then what are they using for the RES reset?

OG

C5:0.ACC = 1, light comes on
C5:0.ACC = 2, counter resets

I really don't recall about the number transition. It didn't go backwards though, because I saw a technote on that so I'd remember. I also don't recall if the output light turned on.. :( I would guess it didn't though, because if the light comes on with one press of the pb, and off with the other (his intention), I don't think anyone would care if you saw the transition on the counter from 1 to 2.

Maybe I shouldn't have started this thread. I'm very very tired. Haha
 
Last edited:
The CTU instruction has a strange feature.

If the counter is reset (RES) while the count contact is still true then the counter will indeed reset to zero but immediately count up to 1. To resolve this you must do one of the following:

Make sure the count contact is OFF before resetting the counter. let's say I:0/0 is the input.

XIO I:0/0 EQU C5:0.ACC 2 RES C5:0

or do a one-shot of the input using the result to trigger the CTU count.
 
So, as in Berne's comment, are they using an EQU (equal) instruction?

If the count = 1 then turn on the light, if the count = 2 Reset the count?

If you don't see it counting from 0 to 1, it is getting reset somehow or it is never executing.

To see if maybe the second one is what's happening, throw a branch around the light that is supposed to be energizing. In the branch add an OTL using an unused binary bit.

Then see if the bit is turning on. If it is, you know the logic is executing and the counter did count up, but it was reset so fast we never saw it.

You can right-click on that bit afterward and Toggle it back off.

OG
 
So, as in Berne's comment, are they using an EQU (equal) instruction?

If the count = 1 then turn on the light, if the count = 2 Reset the count?

That's correct. Like I said, when I had him change it to a CTD instruction it worked.

Jus thought it was a bit odd.

Thanks for the replys everyone. I'll keep the tips in mind for next time.

Also.. OG- Sorry my logic up there was confusing. Didn't even thing to use the instruction abbreviations.
 
Last edited:

Similar Topics

I'm trying to dig to the source of a minor "recoverable" system fault throwing a fault light on a machine that has been confusing my operator...
Replies
3
Views
72
I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
87
Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
113
Hello All, Was hoping I could get a little help with Modicon ladder logic. This is the first time I have seen Modicon logic and currently trying...
Replies
6
Views
259
Hello all, I am currently trying to establish a message instruction to pass data from a 1756-L73 to a 1756-L71. My communication path from the...
Replies
8
Views
352
Back
Top Bottom