One Shot Rising

sauce9753

Member
Join Date
Nov 2005
Location
alabama
Posts
1
I am confused about descriptions people have posted on the web about a one shot rising instruction such as a rung with a NO contact which is a momentary start button then the OSR instruction then the output instruction. Why do they even need a OSR instruction after a momentary pushbutton? I know that it used to trigger a output for one scan only, But wouldn't it be the same exact thing as pressing and releasing a momentary switch that has no seal in circuit and that a OSR instruction is just a momentary switch that's programmed in to the ladder logic family so it can work programmatically in a ladder logic program rather than having to manually pushing a button?
 
When you consider "scan time" is in milliseconds, or microseconds, pushing a button momentarily actually triggers the input for many scans. The purpose of the OSR is to make the output true for one scan of each push (on/off transition) of the pushbutton.

(y)
 
Also "Contact Bounce"

http://www.google.com/search?q=boun...s=org.mozilla:en-US:official&client=firefox-a

Wikipedia:

Contact bounce

Contact bounce (also called chatter) is a common problem with mechanical switches and relays. Switch and relay contacts are usually made of springy metals that are forced into contact by an actuator. When the contacts strike together, their momentum and elasticity act together to cause bounce. The result is a rapidly pulsed electrical current instead of a clean transition from zero to full current. The effect is usually unimportant in power circuits, but causes problems in some analogue and logic circuits that respond fast enough to misinterpret the on-off pulses as a data stream[4].

Sequential digital logic circuits are particularly vulnerable to contact bounce. The voltage waveform produced by switch bounce usually violates the amplitude and timing specifications of the logic circuit. The result is that the circuit may fail, due to problems such as metastability, race conditions, runt pulses and glitches.

The effects of contact bounce can be eliminated by use of mercury-wetted contacts, but these are now infrequently used because of the hazard of mercury release. Contact circuits can be filtered to reduce or eliminate multiple pulses. In digital systems, multiple samples of the contact state can be taken or a time delay can be implemented so that the contact bounce has settled before the contact input is used to control anything. One way to implement this is by using a SR Latch.[5]
 
another very simple example is to keep a lazy operator from "tying down" a reset button, etc. ... using a "one shot" can help make sure he has to push (and then release) the button each time he wants to make something happen ...
 
The name 'momentary' for a pushbutton was probably better than 'not held in the ON state unless someone's finger stays on it or some other heavy object is put on it' pushbutton. Another would be 'not-maintained'.
 
On second thought my post #3 really does not apply to why you use one-shots. Too late to delete it though. Oh well, it is useful info anyway.
 
another very simple example is to keep a lazy operator from "tying down" a reset button, etc. ... using a "one shot" can help make sure he has to push (and then release) the button each time he wants to make something happen ..
.This is my main reason similar to positive/negative transitions don't care if its on or off just that it definitely changed state and is not damaged.
 
Try the following:


MOMENTARY_PB
I:0/0 B3/0
---] [-------[OSR*]---+ADD----+-
| N7:0|
| 1|
| N7:0|
+-------+

MOMENTARY_PB
I:0/0
---] [----------------+ADD----+-
| N7:1|
| 1|
| N7:1|
+-------+



*use ONS on ML/CLX/PLC5 platforms

What you will see is that N7:0 will increment by only 1 count each time you press the button. N7:1 will increment by several counts each time you press the button. There are thousands of situations for which you might use a OSR or ONS, but this demonstrates why sometimes a momentary PB by itself is not a solution.

Here is another example, one that is a common topic on the board, a flip/flop or toggle. When the momentary button is pressed the output will turn on. When it is pressed again the output will turn off.


MOMENTARY_PB
I:0/0 B3/0 B3/1
---] [--------[OSR]-----------( )-

B3/1 O:0/0 O:0/0
-+---] [---+---+---]/[---+----( )-
| | | |
| | | |
| | | |
| O:0/0 | | B3/1 |
+---] [---+ +---]/[---+


 
Last edited:
Here is something that is rarely mentioned when discussing one-shot instruction. Assume there are 3 N.O. contacts in series, the OSR instruction and finally the output coil.

---A---B---C---OSR--------( )----

Does the "OSR" look at only the instruction IMMEDIATELY prior to it or at ANY of the contacts in the rung prior to the "OSR" instruction. If "A" and "C" are true and "B" comes on last will the OSR still turn on the coil. Hope this is clear enough.

To simplify things, let's just keep the replies to only AB PLC's (because they have such a huge market share).
 
As I understand the OSR, the answer to your question is 'yes'. The OSR will SET the output for one scan after input "B" goes set in your example.

For clarity, I use the word SET in place of 'true' or 'on', and RESET in place of 'false' or 'off'.
 
MasterBlaster: I like that, so "Set" is what I'll use from now on.
Thanks for the reply.

Your response is how I understand it too. My reason for asking it is I think a lot of inaccurate results happen because programmers do not take that into consideration. I'll sometimes create a separate rung with only the address I want to look at and the OSR. May seem like a waste of logic, but memory is cheap.
 
Last edited:
I would be careful with the use of "Set" "Reset" as they mean different things depending on the brand of PLC you use. When I hear "Set" "Reset" I think "Latch" Unlatch". In the AB world the output after the one-shot is "True" for one scan. See below for an excert from AB help files.OSR [One Shot Rising]
Operation:

When the rung conditions preceding the OSR instruction go from false-to-true, the OSR instruction is true for one scan. After one scan is complete, the OSR instruction becomes false, even if the rung conditions preceding it remain true. The OSR instruction becomes true again if the rung conditions preceding it transition from false-to-true.
OSR [One Shot Rising]
 
Mickey, I think you've been involved in some of the SET, RESET, LATCH, UNLATCH discussions on here. And to me you actually make the case for NOT confusing them. SET is different from LATCH and RESET differs from UNLATCH. But SET is always SET and RESET is always RESET, and any discussion of logic (especially in my world of A-B) is made more concise using those terms.

Bill
 
Here is something that is rarely mentioned when discussing one-shot instruction. Assume there are 3 N.O. contacts in series, the OSR instruction and finally the output coil.

---A---B---C---OSR--------( )----

Does the "OSR" look at only the instruction IMMEDIATELY prior to it or at ANY of the contacts in the rung prior to the "OSR" instruction. If "A" and "C" are true and "B" comes on last will the OSR still turn on the coil. Hope this is clear enough.

To simplify things, let's just keep the replies to only AB PLC's (because they have such a huge market share).

The OSR (ONS in ML/PLC5/CLX) examines the rung state, it doesn't know what instructions are in front of it nor does it re-examine them or their addresses. All it knows is the state of the rung at its input.

If the input to the OSR instruction is FALSE it clears the storage bit and passes FALSE out to the reminder of the rung. If the input to the OSR instruction is TRUE then it checks its storage bit. If the storage bit is clear, or 0, then it sets the storage bit to a 1 and passes TRUE out to the remainder of the rung. If the storage bit is set then it passes FALSE out to the remainder of the rung.
Code:
If  (RungIn is False then {
   Storage_Bit = False
   RungOut = false
}
If (RungIn is True then {
   If (Storage_Bit is False then {
      Storage_Bit = True
      RungOut = True
   }
   Else {
       RungOut = False
   }
}
 
here's another potential "gotcha" pertaining to the words SET and RESET ...

in MOST (but not all) Allen-Bradley documentation, the word SET means "to write a status of ONE into a bit/box" ...

conversely, in MOST (but not all) Allen-Bradley documentation, the word RESET means "to write a status of ZERO into a bit/box" ...

but ...

just to make it confusing, SOME Allen-Bradley documentation will say something like this: "be sure to SET the bit to a ZERO" ...

in all honesty, the ONLY way that I'm personally comfortable with is to ALWAYS refer to the status of the bit/boxes as either "a status of ONE" or "a status of ZERO" ... that way there is never anything ambiguous about the situation at hand ...

now then ...

going a little further into the ONE-SHOT discussion, here's a simple Boot Camp-style experiment that can help understand what's going on under the hood ... (set up the rung in a spare processor, if possible) ...

in the figure below, leave the switch in the ON condition ... then go to the status bit for the OSR and manually toggle it (note that it's so fast that you probably won't see the status change on the screen – but the status DOES change inside the processor's data table) ... watch what happens to the value in the ADD location – and compare those results to the description posted by my distinguished colleague Alaric ... this might help clear up some of the confusion ...

party on ...

osr_toggle.JPG
 
Last edited:

Similar Topics

Hi Guys! I'm writing a Function Block and I want an internal counter to reset at the call of this FB. Now I have searched at it seems I can't...
Replies
7
Views
3,596
I am new with siemens which instruction is used as Rising Edge One Shot. |p|. I need whenever Rising edge is detect only execute instruction one...
Replies
1
Views
3,556
RSLogix 500 v9 OSR storage bit & output bit I am programming a sonic welding generator and I am stuck on an operation I need to perform and I'm...
Replies
3
Views
2,231
Can you place one shot rising/falling pulse contacts using the IEC Dev v7 ladder editor (LDP, LDF Etc..)? If possible can someone tell me how...
Replies
2
Views
1,773
I'm using RSLogix 5000 Function Block Diagrams. I am trying to increment a counter using One Shot Rising with Input (OSRI) block. The OutputBit...
Replies
5
Views
4,320
Back
Top Bottom