CTU Count Up tenths and hundreds separately Logix500

TimD

Lifetime Supporting Member
Join Date
Aug 2007
Location
New Hampshire
Posts
235
Hello, I have a flowmeter, it pulses once per gallon.

I have my discrete input pulsing away along with the flowmeter.

I can count the tenths portion fine, but I wanted to extend my counter 'resolution' by separating pulses 0-99 by a separate counter for hundreds, thereby giving me 32767 gallons until overflow occurs.

I have two lines of code, one, a CTU counter counting up. I want to reset the counter after 100 pulses and increment my second CTU by one. I used the preset field, but this does not help. It seems simple, anyone out there have a similar way to do this that works?

Also, should I be using retentitive counters? Thanks!

Tim
 
Greetings Tim ...

if I understand your question, you might skip the counters and use something like this instead ...

and all Allen-Bradley counters are already "retentive" ... specifically, they don't lose their "counts" when the power is cycled ... is that what you meant? ...
 
Hi Ron,

Thanks for the tip! I am going to try this right now, seems like a smarter way to write a pulse counter.

Thanks.

Tim
 
I have two lines of code, one, a CTU counter counting up. I want to reset the counter after 100 pulses and increment my second CTU by one.
Ron's method is elegant and keeps the rungs to a minimum for even large numbers. But if you are curious how to get your original idea to work (how to cascade two or more counters), here it is. The One Shot Rising is needed in case the Input is still on after C5:0 is reset by Rung 001.

Counters_Cascaded.JPG
 
Last edited:

Similar Topics

Hi, I need to use my CV value from my CTU. if CV = 1 : Red light turns ons if CV = 2 : Green light turns ons, but red goed out if CV = 3 ...
Replies
2
Views
292
Hi, I am confused regarding TIA portal and counters. I use CTU. I wish to have one counter counting 0-10. When it reaches 10 is shall increase...
Replies
23
Views
3,178
I haven't come across this before. I am trying to understand why the counter doesn't reset to 0, when the .dn is true? It immediately puts a 1 in...
Replies
18
Views
4,576
This counter is counting when bits_from_traypacker is true (messaging from other machine, this is the servo cycle). After counting 3 it should...
Replies
8
Views
3,283
For a week now, my coworker and I have been troubleshooting a machine which has been displaying some crazy behavior. HMI values were changing on...
Replies
19
Views
4,258
Back
Top Bottom