Newbe - RSlogix and Counter / Reset basic problem - Thanks!

mitureg

Member
Join Date
May 2013
Location
Canada
Posts
199
Hello, first of all thank you for reading this post. I am pretty new at PLC programming!

I have a problem with a CTU and the reset function. You should have the rungs in attachment.

It's a bottling plant. The packer at the end of the plant needs to wait 3 bottles before activating the stacker.

When the stacker is activated, I thought of resetting the CTU to 0 "zero", but the CTU resets only to 1 then counts 2-3.

So basically, 3 bottles are counted the first time and from then, only two!

Am I doing anything wrong? Is there a more standardized way of programming a bottle stacker?

Much appreciated! :site:

Bottling_Counter_Res_Capture.jpg
 
The counter is counting to three and then resetting as it should. The problem is that because the counter sensor is still closed when the counter resets, the counter is retriggering.

Add an OSR instruction between the counter and the counter sensor. Use an unused binary bit (such as B3:0/0) as the address for the OSR. Make SURE that you use a bit not being used anywhere else.

OG
 
Hi,
Counters can be tricky. They have built-in one shot capabilities, but there are some things to watch out for, especially when the RES instruction is used.

The RES function does just what it's name implies: it RESets the counter, but not just the accumulator, it resets all the associated status flags that go with that instruction, including the "one-shot" memory flag. It basically returns the counter to its "out of the box" condition.

What this means in your case is that if your counter sensor is on when the ACC = 2, then your counter will go to 3. As long as nothing else happens, your ctu will remain = 3. When the your RES instruction executes, the count will be = 0. However, if your counter sensor still remains on (no false-true transition) after the RES, then on the very next scan the counter will increment to 1. So that means that across a RES a counter can count twice for 1 rung true transition.

The way to deal with this is to either
a) Put a ONS (one shot) between the sensor and CTU instruction, or
b) Do not execute the RES until the counter sensor is Off (this will also avoid double triggers)

Good luck and HTH

🍻

EDIT: I rambled on too long and Opera beat me to it!
 
Thank you very much for you replies guys. I followed your instructions and here it is with a One-Shot-Rising associated to a bit. I can now have the counter reseted to zero value even though the sensor might still be closed from the last trigger after the reset.

Here is the new rung:
(See capture file)

Cheers 🍺

Bottling_Counter_Res_Capture2.jpg
 

Similar Topics

First post! I'm learning about PLC's and I'm wondering if there is a way to have a variable resistance output? This would be to vary the speed...
Replies
7
Views
1,804
This is my first post so I thought it would be best in practice. Like my title sais I am new to programming so I have no idea were to start my...
Replies
5
Views
1,980
Hello! all im new here to the site.and want what y fellers have which is PLC knowlodge,so i thought id ask,what is the best hands-on PLC training...
Replies
6
Views
2,694
HI All, I've got a Direct Locic DD-05DD with an F0-04AD-2 4 analog input module. Have a 0-10V current transducer connected to input 1 on the...
Replies
1
Views
1,645
Running a Micrologix 1000 DH-485. The system currently works great. But, the operators have requested some control over the internal timers that...
Replies
2
Views
1,581
Back
Top Bottom