Rs5000 CTU caught in a loop

toddp65

Member
Join Date
Aug 2014
Location
Florence, Ky
Posts
282
This counter is counting when bits_from_traypacker is true (messaging from other machine, this is the servo cycle). After counting 3 it should reset and the DN go true and drop out the sequence. It goes to 2 and then back to one. The backup eye bit that starts the whole sequence remains false. The purpose of this is to eventually stop and start a drive to lower the back pressure of 6 packs while being indexed into the packer (the servo is the push for the indexer). I only need it to do it for 3 cycles or the servo (thus the counter). I initially used Latch and Unlatch and it did the same thing but would eventual count up to the setpoint and go DN.

Thoughts?
 
Last edited:
Move your counter reset to rung 145 above the Tray counter backup sequence.

Or move rung 146 just below counter.
 
The problem is that when the cycle completes, the RES is resetting the CU bit which allows rung 147 to re-trigger a count even though the input hasn't toggled. This causes a double count. It is a common programming mistake.


Two solutions.....

1. Put an XIO of the CTU CU count up enable bit on the rung (149) with the RES. Put if before the RES.

2. Add a ONS between the inputs and the CTU on rung 147. Assign an unused bool tag to the ONS.

Either of those should clear the double-count.

OG


*****EDIT*****
As cwal61 mentioned moving the rung.........that has been a common practice of mine. Put the reset above what it is resetting. That ensures one full scan where the DN bit would be set. As it is now, the DN bit on rung 146 will never seen the DN turn on. The DN turns on on rung 147 then turns off on rung 149. So, three solutions.
 
Last edited:
Adding to what was said about order of operations, when I have a situation like this, I will often put the RES instruction in the same rung on a branch right above the CTU or timer instruction. This makes it less likely to get moved out of order in the future.
 
I'm wondering if Tray_Packer_backup_Sequence is clearing out too early. In your original configuration (from the your first post's attachment), what happens if you put a XIO of Tray_Packer_backup_Sequence before the OTE (tag: Backup_Seq_End) instruction on rung 148?
 
I'm wondering if Tray_Packer_backup_Sequence is clearing out too early. In your original configuration (from the your first post's attachment), what happens if you put a XIO of Tray_Packer_backup_Sequence before the OTE (tag: Backup_Seq_End) instruction on rung 148?

I'll have to look at this when I get back to the program. Thanks, all
 
After re-reading your post I have another suggestion.
After counting 3 it should reset and the DN go true and drop out the sequence. It goes to 2 and then back to one.
This means the CTU.DN reset the counter while the Counter rung was still true on the 3rd count. The (RES) instruction also resets the CTU.CU bit of the counter. Since the counter rung is true and you reset the CU bit it gives it a false to true transition. So it went to 3 reset back to zero then counted to 1. You just don't see 3 because the (RES) reset it back to zero.
note: If you use the CLR Instruction of the CTU.ACC in will not count unless the rung has a false to true transition.

The backup eye bit that starts the whole sequence remains false. The purpose of this is to eventually stop and start a drive to lower the back pressure of 6 packs while being indexed into the packer (the servo is the push for the indexer). I only need it to do it for 3 cycles or the servo (thus the counter). I initially used Latch and Unlatch and it did the same thing but would eventual count up to the setpoint and go DN.

Thoughts?

Don't reset the counter until the backup condition is clear.

Logic: If CTU.ACC = 3 and Backup eye is true (CLR) CTU.ACC
 

Similar Topics

I have recently made a career change after 25 years of being an electrician. I am officially a junior automation controls programmer. I recently...
Replies
11
Views
359
Hi Guys, Hoping that someone could please confirm if the 1756-IF16/B is/isn't compatible with the 1756-L1 5550 processor(13.24). I'm sure I...
Replies
2
Views
100
Hello, I need help making a logic modification to a RS Logix 5000 program. I can email the program and give plenty of insight to it plus I have...
Replies
4
Views
2,193
Hey folks I was wondering how one puts shortcuts on the logic display for instructions. A few weeks back another programmer added them for me...
Replies
2
Views
968
Hello, I'm struggling with getting an email to send using an eweb module on a controllogix system. Any chance I could get someone here to help?
Replies
4
Views
1,849
Back
Top Bottom