Question about OSR

Rocguy

Member
Join Date
Dec 2016
Location
Chicago
Posts
48
Ok, I have a dumb question here. The program is straight from the textbook. It counts cases of product as they pass a sensor or prox switch.
The prox is I:1/3 in the top rung with the counter.

Question is, if a one shot is true for one scan only, how does the counter continue to count after one scan, the product with a false OSR instruction in front of it on the rung?

I'm new and puzzled by this

OSR and counter.jpg
 
Last edited:
In the setup pictured, without the OSR, the counter will count up as long as a box is blocking the pe, hence the one shot.

For some reason my thought process is... a box is moving in front of the sensor. It goes true as it detects the object. It doesn't go false until the object is no longer there so the counter should only increment by 1.

The book says not all PLC manufacturers have this instruction so, how is this counting program accomplished for one that doesn't?
 
Actually in the line shown the OSR is not necessary the counter will only count up by 1 each time the input is true.
counters only count on the leading edge of the true rung statement.
you would use the OCR if you use the ADD statement to count
 
Actually in the line shown the OSR is not necessary the counter will only count up by 1 each time the input is true.
counters only count on the leading edge of the true rung statement.
you would use the OCR if you use the ADD statement to count

Well now this is conflicting. We haven't reached this ADD statement you speak of yet so, I haven't heard of it.
 
If you are asking how to make your own OSR for a PLC that doesn't have the feature just:

In place of the OSR put a XIO [your-own-bit]

Then create a new line after the counter that checks if the prox is on and put an output bit turning on [your-own-bit], this bit will stay on as long as the prox is tripped and prevent the counter from multiple counts.

Some PLC's, as GaryS pointed out, have an internal OSR in every counter instruction that requires the input going high to count once, but not all. In my younger days I was perplexed by a non-Allen Bradley PLC counting a few hundred times when I thought it would only count one. Turns out that PLC counted every scan the rung was true.
 
I agree with OG...

Even though the counter will only count when it sees a false-to-true rung transition, we need to present it with real-world data.

If you take the OSR out, the RES of the counter when it is done, definitely will cause the counter to count again, the prox will still be detecting the same box that caused the "done count".

And if the operator decides to reset the counter, the OSR guarantees that only new boxes are counted.

I can't think of a simpler way to describe it....
 
I did look again the function hasn't changed
the counter will add 1 to the acc value when the rung goes true it will not add another until the rung goes false then true again.
the reset is independent of the count it will be reset with the DN bit or the input is true but the count will not be added until the rung goes false and true again.
a counter adds 1 to the acc of the counter for every false to true transition of the count input. the ONS only blocks the true rung from reaching the counter but the rung in front of the ONs must go false to reset the ONS
if the rung stays true for whole time the count will only be 1
either way the count only add 1 for every false to true action on the count up input
 
I did look again the function hasn't changed
the counter will add 1 to the acc value when the rung goes true it will not add another until the rung goes false then true again.
the reset is independent of the count it will be reset with the DN bit or the input is true but the count will not be added until the rung goes false and true again.
a counter adds 1 to the acc of the counter for every false to true transition of the count input. the ONS only blocks the true rung from reaching the counter but the rung in front of the ONs must go false to reset the ONS
if the rung stays true for whole time the count will only be 1
either way the count only add 1 for every false to true action on the count up input

Without the OSR.....

Last box on conveyor is counted,
Counter .DN bit is set,
.DN bit resets the counter,
on the next scan, the same box is counted as the first box of the next "batch", because the proxy will still be true, the counter has been reset so it "see's" a rung false to true transition.

With the OSR....
Last box on conveyor is counted,
Counter .DN bit is set,
.DN bit resets the counter,
on the next scan, the same box is NOT counted as the first box of the next "batch", because the box proxy has to go off before the next box is "seen"
 
as I said the reset and count up are independent functions one can happen without the other
As long as the count rung stays true the counter will only count 1 time
in the next scan after the reset the counter acc value will be 0
it needs a false to true transom to count, holding it on will do nothing.
the best way to count the boxes is to have the sensor connected to an off delay timer,
box present timer DN bit is on the when the box is past the timer times down and resets the DN bit
preventing the sensor from fluttering on and off with the box present
the DN bit of the timer is used as the input to the count up
this will keep you from counting multiple times for each box.
 

Similar Topics

I'm looking at an offline copy of a program that has these two rungs, in this order (see attachment). B3:16/3 is a OSR in the first rung and an...
Replies
9
Views
2,389
Hi, What would stop an OSR from outputting? I had the attached program running for weeks without a problem, now the OSR won't output when the rung...
Replies
4
Views
1,665
I was looking through code yesterday and found where someone used a OSR to initiate alarm notification. However... the OSR occurs in a routine...
Replies
4
Views
5,417
I've always been a bit confused with these {OSR}s. What I wonder is, if I use one [as indicated on the picture] will it turn on the output...
Replies
16
Views
6,577
I have an HMI 2711R - T4T Series B, and I want to know which PLCs, besides Micro 820, can communicate with it.
Replies
2
Views
55
Back
Top Bottom