COUNT / ADD FUNCTION on RS LOGIX 5000 / STUDIO LOGIX

alive15

Member
Join Date
Oct 2015
Location
Montgomery, AL
Posts
690
Good afternoon,

I'm using RS Logix 5000 on an AB 1769 L24ER-QBFC1B, and basically in my logic, whenever a prox switch is made, I want the counter to go up only by 1 every time the prox switch comes on. I have a prox switch mounted on a table that spins, so basically the prox counts the revolutions of the spinning table. What happens, the prox switch will be made for a about 1 second and then cuts off. I thought the counter would only increase by one, but it increases about 330-ish every time the prox is made. So I tried the add function, which solved the problem, but now, even the add function is doing the same thing. How can I make the Count or Add function only increment the revolution value by 1?

Thanks.
 
The CTU instruction only increments by one each time the conditions preceding it on the rung go from False to True.

The ADD instruction is executed every time the rung is scanned if the conditions preceding it on the rung are true.

What you're seeing is almost certainly due to an unstable or "bouncy" input signal. Maybe a wire is loose, or the proximity switch isn't tuned or mounted well, and the input is going true many times.

Since the input speed is so slow, the easiest way to solve this is to add a "debounce timer" so that the input needs to be true for maybe 100 milliseconds so that the timer will complete.

Then use the .DN bit from the timer to perform the Count or Add operation.
 
Thanks for the replies, I'll try out the debounce timer, that sounds like a good idea.

The one shot did the same thing surprisingly, but the counter number did not increase as much with the ONS.
 
330-ish counts during a 1 second on event would equate to a pulse every 3 milliseconds. In order to read that, assuming there is a 50% duty cycle to the signal, would require a 1.5 millisecond scan time. Does that number make sense given the processor you are running, the size of the program and the sensor you are using? All I'm saying is that 330 counts/second seems pretty fast for a physical input into a general purpose plc input.

Keith
 
[Facepalm]

Thanks for actually doing the math, Keith. This probably isn't contact bounce but rather something in the code that is creating a flip-flop every program scan.

This is going to need a screenshot.
 

Similar Topics

While I resolved my other issue, I am having some trouble adding tags to the Historian. Right click on application in FTView Studio, Add...
Replies
1
Views
4,705
hi was wondering can anyone help a customer has asked for a packs pre minute counter to be added to a elau c400 system has anyone got a bit of...
Replies
0
Views
1,321
What is the raw count of Allen Bradley Flex Analog Output Module 5094-OF8 raw count?
Replies
1
Views
126
I am working on a Markem X40 printer which uses NGPCL Commands and needs to send commands using a .net program. I need help with the following...
Replies
1
Views
139
Hi, I'm programming in RSLogix 500, and I'm wondering how I would program a Jog command that does not increase the encoder count. Basically we'd...
Replies
3
Views
302
Back
Top Bottom