Forum

1756-L71 bottle cou...
 
Notifications
Clear all

[Solved] 1756-L71 bottle count is exactly double on one line, ONS and ADD, sensor is clean

7 Posts
3 Users
0 Reactions
103 Views
(@valh7)
New Member
Joined: 2 years ago
Posts: 0
Topic starter   [#182]

1756 l71, V30, filler line 6. Bottle count is a routine called Count_Bottles doing ADD Total 1 Total, called by a JSR behind an ONS off the fill head sensor, so it should run once per bottle. Line 6 counts exactly double, every bottle. Lines 4 and 5 have the same routine copied over and they count right.

I scoped the sensor and it's one clean pulse per bottle, so I tried a new sensor and a different input and got the same. Then I swapped the ADD for a CTU and that counted one bottle and never again, so the ADD went back in.

It's counted double since commissioning and the operators just divide by 2. What's different about line 6? The CTU counting one bottle and then never again is the bit that's nagging at me, does that tell anyone anything?


Advertisement

   
Quote
(@rsdave)
Trusted Member
Joined: 2 years ago
Posts: 65
 

Studio version, and how many places is Count_Bottles called from? Go to the routine, right click, Cross Reference, and look at the JSR entries.


Advertisement

   
ReplyQuote
(@valh7)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

V30 like I said. Cross ref shows two JSRs. One in MainRoutine where I expected it, and one in a routine called Startup_Old behind its own ONS off the same sensor. Lines 4 and 5 don't have Startup_Old at all. So I think it's running twice per bottle?



   
ReplyQuote
 kaim
(@kaim)
Active Member
Joined: 2 years ago
Posts: 17
 

Twice per bottle, yes. Each JSR sits behind its own ONS and each one sees the same rising edge and fires once. Two calls, two ADDs, one bottle. The one-shots are doing exactly what they're for, there are simply two of them.

Your CTU test says the same thing a different way. Inside a routine that's only scanned on the edge the CTU rung never goes false, so the CU bit never clears and it counts once forever. Not a Logix quirk either, same thing happens in any runtime where a block keeps its own edge memory.



   
ReplyQuote
(@rsdave)
Trusted Member
Joined: 2 years ago
Posts: 65
 

Startup_Old is a leftover from commissioning. Pretty sure someone copied the count in for testing and forgot about it. Delete that JSR, or the whole routine if nothing else in it is live, but check the cross reference on every tag in it first. A 1756-L71 won't blink either way. If you ever do need the count in two places, one call, and the second place reads Total rather than adding to it.



   
ReplyQuote
(@valh7)
New Member
Joined: 2 years ago
Posts: 0
Topic starter  

Deleted the JSR in Startup_Old, then the routine, nothing else in it was referenced. Line 6 counted 1 per bottle for the whole shift, first time since 2022.

Count_Bottles was being called from two places and each call had its own ONS in front of it, so every bottle got added twice. One call and it counts right. The routine and the one-shot were never the problem, the second caller was, and the L71 was doing precisely what it was told.

What I'm still not sure about is what Startup_Old was for in the first place. Nobody here remembers and the commissioning guy is long gone. Thanks rsdave and kaim.



   
ReplyQuote
(@rsdave)
Trusted Member
Joined: 2 years ago
Posts: 65
 

Three years of dividing by two. Startup_Old was somebody's test rig, I'd bet.



   
ReplyQuote
Share: