how does ab one shot work

georgia boy

Member
Join Date
May 2005
Posts
14
hi guys

i know this one seems newbie i am pretty decent on basic ladder logic ( self taught )but i have never had to use one shots and today i encounterd some . how do one shots work in detail and how are they best applied . i know they are to only work for one scan ?
 
Each one-shot instruction has a storage bit assigned to it. When the processor encounters a one-shot instruction and the rung is true up to the one-shot, the processor checks the storage bit. If it is clear, the processor sets the storage bit and then continues scanning the rung as true. If the bit is set, then the processor scans the rest of the rung as false. Thus it will be true for one scan only. If the rung prior to the one-shot is false, then the processor will clear the storage bit.

AB has several variations of the one shot depending upon which PLC platform you are using.

In the SLC-500 the one shot is an OSR instruction and it is an inline instruction. There are some restrictions on using the OSR in branches on the SLC-500 platform, so check the manuals or online help.

In Micrologix 1100,1200,1500, PLC-5 and Control-Logix processors the one-shot is availalbe as an inline instruction as ONS, or as an output instruction as OSR (one-shot rising) and OSF (one-shot falling - a single scan pulse as rung turns false)


Below is a data table for both of these two rungs which impliment a leading edge one shot with Bit B3/1

I/0 B3/0 B3/1
----] [------[ONS]--------( )-- (substitute OSR in a SLC500)

Or

I/0
----] [------------+-OSR-------------+
|One Shot Rising |
|Storage Bit B3/0|
|Output Bit B3/1|
+-----------------+

|IF these conditions| |Then Processor Sets|
| I/0 | B3/0 | | B3/0 | B3/1 |
| 0 | 0 | | 0 | 0 |
| 1 | 0 | | 1 | 1 |
| 1 | 1 | | 1 | 0 |
| 0 | 1 | | 0 | 0 |






For an OSF the table below applies.

I/0
----] [------------+-OSF-------------+
|One Shot Falling |
|Storage Bit B3/0|
|Output Bit B3/1|
+-----------------+

|IF these conditions| |Then Processor Sets|
| I/0 | B3/0 | | B3/0 | B3/1 |
| 0 | 0 | | 0 | 0 |
| 1 | 0 | | 1 | 0 |
| 1 | 1 | | 1 | 0 |
| 0 | 1 | | 0 | 1 |



 
Last edited:
Continuing....

As a matter of good programming practice, a one shot storage bit should NOT be used more than once. Writing to the storage bit elsewhere can cause unpredictable results and can be a major pain to debug.

But there are some exceptions.

In the SLC-500 suppose we needed a fallig edge pulse - we need something to be on for one scan just as we turn something off. The OSF instruction is not available.


Suppose we have this rung and we need a one shot
pulse when O:0/0 turns off.

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

And so we add the following rung:
O:0/0 B3/0 B3/1
---]\[-----[OSR]-------( )---



At first glance you might think this is OK, as soon as O:0/0 turns off we will get our pulse, right? But there is another condition that will generate a pulse as well. When the processor makes its first scan after power up or switching to run from program O:0/0 is off and a pulse will be generated. This pulse is not a true falling edge pulse - one where we get a pulse only after O:0/0 has actually been on and then shuts off. In some applicaitons this won't be a problem, but in others it could be a really big problem.

So you might be tempted to just throw in a first pass bit like this:

O:0/0 S:1/15 B3/0 B3/1
---]\[----]\[----[OSR]-----( )-


But it won't work. It will just delay the pulse by one scan, (In the SLC-500/501 you can't put an instruction between the OSR and the output instruction)

But presetting the storage bit will make it work like a true falling edge one shot.

First Pass
S:1/15 B3/0
---] [----------------(OTL)--

O:0/0 B3/0 B3/1
---]\[-----[OSR]-------( )---



This little bit of ladder legerdemain is not necessary in processors that have an OSF instruction which behaves as a true falling edge one shot.
 
wow..a lot changed from the original reply!!

I must say AB's way of one shots always confused me..I mean i get it...(somewhat) and can work with them but i must admit modicon gets an A+ here..(Its not to often i say that!!) I just love there +transition |P| and - transition |N| contacts..
 
Alaric said:
Continuing....

As a matter of good programming practice, a one shot storage bit should NOT be used more than once. Writing to the storage bit elsewhere can cause unpredictable results and can be a major pain to debug.

.

Just read this..Alaric brings up a good point..I at first figured i could use the storage bit multiple times...It turns out you can if you want screwy things to happen..If you dont..then dont use the same bit..

BTW thanks Alaric your explination has cleared up a few things i had about this subject..I knew how they worked but not why..now i know..
 

WAS
Input-1 Input-1
---| |------|/|-----+--( SET ) WAS Input-1
|
+--( Input-1 Just ON )


WAS
Input-1 Input-1
---|/|------| |-----+--( RST ) WAS Input-1
|
+--( Input-1 Just OFF )



.
Use "Input-1 Just ON" and "Input-1 Just OFF" as many times as you want.
They're exactly the same as |P| and |N|.

(44)
 
perhaPS
Terry Woods said:

WAS
Input-1 Input-1
---| |------|/|-----+--( SET ) WAS Input-1
|
+--( Input-1 Just ON )


WAS
Input-1 Input-1
---|/|------| |-----+--( RST ) WAS Input-1
|
+--( Input-1 Just OFF )



.
Use "Input-1 Just ON" and "Input-1 Just OFF" as many times as you want.
They're exactly the same as |P| and |N|.

(44)

Perhaps..but its a lot less programming with |P| and |N|
 
In real terms (normal ladder) it is two rungs



Input 1 Bit2
--| |------|/|------(Bit1)


Input 1
--| |---------------(Bit2)

Bit 1 becomes the one shot
If input 1 is on (rising edge) then bit 2 is off, bit 1 comes on
then bit 2
on next scan bit 2 is on so bit 1 goes off, all reset when input 1 goes off so hence a oneshot for one scan of plc.
Mitsi have a ons & onf function
it's an arrow in the contact that does the same thing but you do not need a memory bit as it acts on the contact direct.
 
darrenj said:
wow..a lot changed from the original reply!!

I must say AB's way of one shots always confused me..I mean i get it...(somewhat) and can work with them but i must admit modicon gets an A+ here..(Its not to often i say that!!) I just love there +transition |P| and - transition |N| contacts..

But its slightly different. The modicon instruction monitors the bit specified, the AB OSF/OSR/ONS monitors the rung logic preceding it.

Good programming practices will keep one-shots to a minimum.
 
I'm not sure how far it is taken in Modicon, but I know that Mitsubishi has a P version of just about every instruction for this purpose.

Personally, I think the complexity of the instruction set makes it an uglier option.

Then again, I spend the vast majority of my time on A-B PLCs and I'm more comfortable with their way of doing things.
 
The modicon -]P[- and -]N[- instructions are easy to use, but then I never considered the AB oneshots to be difficult either. For a single input oneshot the Modicon P and N instructions have the beauty of simplicity. But for a multiple input oneshot you then have to program a coil anyways.

In the Modicon there is not an apparent need to program a storage bit, however storage bits do exist. Modicon PLCs store the network as op codes in a 7x11 integer array. The lower bits of each word in the array contain the instruction op code while high order bits are used as the network is solved.
 
thanks

thanks everyone for all the help and examples . i used one shots in a program i finished last night . it works great . thanks so much

georgia boy
 

Similar Topics

Hi all I'm converting an S7-200 program into S7-300. There is a Word Increment command INC_W which takes in a VW address and puts it back into...
Replies
7
Views
2,832
Hi I have a ifix 5.5 application where the operator opens a valve by clicking on a screen object. I can trace from object to data base that it is...
Replies
2
Views
46
Hi, i am using DVP-14SS2 PLC, after program written to plc, when power is reset, plc doesn't run. always need to connect to pc for the run mode.
Replies
0
Views
39
I am trying to connect with a Schneider plc which has a firmware version only available in Somachine v4.2. In Machine expert After taking upload...
Replies
0
Views
126
Back
Top Bottom