What is a one shot ?

Rob S.

Member
Join Date
Sep 2008
Location
Maryland
Posts
739
I have been around industrial automation for 24 years and I cannot believe that I still don't fully understand a "One Shot". Could someone explain that to me , and also an example of a "Real World" situation .

Thanks , in advance. Have a great Thanksgiving.
 
Other users can correct me if i'm wrong, but its my understanding that the way a one shot functions operate is if the logic before the OSR is TRUE, the output after the OSR is true for only one scan cycle. The logic before the OSR must then go false and then back to true before the output goes high again.

From the RSLogix500 help file: "An example would be to use the OSR to freeze rapidly displayed LED values."
 
A one shot is a bit that stays true for only one PLC scan.

Now you can have different types of One Shots depending on what PLC you use but they all basically work the same in that they are only true for 1 PLC scan. The conditions previous to the one shot bit have to change states again to trigger the one shot again.

A real world use for a one shot would be a function you needed to do once when a certain condition is met no matter how long that condition is true.

Good example: You wanted a time stamp everytime some on pressed a button. Teh one shot would be in series with the button and trigger a move comand that moved the current time into the time stmp memory area.
 
A one shot is when your making online changes to a 10 millon dollar process. you most likely will only get one shot!!!! LOL
 
There are three simple types, depending on the platform you are working on and how the control implements it or the programmer programs it.
1. Where a bit is turned ON from the initiating rung until the end of logic, then it goes back OFF.
2. Where a bit is ON from the initiating rung until the rung above it, then it goes back OFF.
3. Where a bit is turned ON from the initiating rung, then held ON until this scan completes and for the next complete scan.

Number 2 is the most common today.
 
One shot condition or output should be On from initiating instruction execution and until the latter is executed (scanned) again.
It should have nothing with the controller scan, as it may be executed in non-cyclic fragment of code (subroutine, interrupt, or subject to bypass by jump).
All controllers I've worked with, operate exactly this way.
 
You asked for a practical example of the use of a one-shot - see pic.

Same input - two add intructions which increment the count....

I only made Sensor true once....and Count1, Count2 were both zero before.

One-Shot truth-table is another way to explain it....

Input Output
0 0 any scan
1 1 any scan
1 0 subsequent scans
0 0 any scan


If you want more explanation than has already been given, feel free to ask.

2011-11-22_222909.jpg
 
Last edited:
it does vary from PLC to PLC
ONS - One shot fires as a pulse Once apon the logic before it becoming true.
OSR - OSF - is a little bit different
Can be reffered to as DIFF(UP) DIFF(DN)
OSR fires a single pulse on the Logic Rising from Bit 0 to Logic 1
OSF Fires a single Pulse on the Logic Falling from Bit 1 to Logic 0
 
and MUST be on the last instruction of a rung before any output instructions.

You are incorrect : the opposite is true - You are free to place a ONS instruction ANYWHERE on a rung - even inside branches, except that it CANNOT be the last instruction on the rung

I think you are confusing ONS with OSR and OSF, which are output type instructions and must be the last instruction on a rung - EXCEPT in the case of Logix5000, which does not have that restriction.
 
If you wanted to increment a count every time someone pressed a button then you could use a one-shot to prevent the count incrementing on every scan while the button was pressed.

ie. Operator presses button. System scans maybe 100 times in the duration it takes for the operator to release the button. You don't want your count to increment by 100 every time - only once. Hence you put a 'one shot' in series with the button so that the system only acknowledges the 'rising edge' of the button and then ignores it until the button is released and pressed again.

;-)
 
If you wanted to increment a count every time someone pressed a button then you could use a one-shot to prevent the count incrementing on every scan while the button was pressed.

ie. Operator presses button. System scans maybe 100 times in the duration it takes for the operator to release the button. You don't want your count to increment by 100 every time - only once. Hence you put a 'one shot' in series with the button so that the system only acknowledges the 'rising edge' of the button and then ignores it until the button is released and pressed again.

;-)

Quite correct - although an integer count is usually handled by using a Counter CTU or CTD instruction, which automatically has "rising edge" detection, or "false-to-true transition" as RA like to call it.

I used "Add 1" in my example above just to demonstrate the principle of the one-shot, but if I really wanted to "add 1", I would most-times use a counter.

However, if I wanted to add 2 numbers together, storing the total back in one of the sources, I would most certainly have to use a one-shot to prevent the add occurring on every scan while the rung is true.
 
Quite correct - although an integer count is usually handled by using a Counter CTU or CTD instruction, which automatically has "rising edge" detection, or "false-to-true transition" as RA like to call it.

Very good point.

I tend to use an 'ADD' for a lot of my counts though as I find the 999 maximum counter value a limitation for a lot of what I'm doing.

;-)
 

Similar Topics

Hello all. This is a very lonnnnnnng shot but worth a try. I have an OMS Group Impact100 metering machine. At this customer it blows foam into 3d...
Replies
0
Views
167
Howdy Everyone, So I have been retrofitting a cell to run different fixtures and updating it with new drives and a few other things. It runs...
Replies
15
Views
1,457
Hi all, I am working on a ladder program in AS and I was to trigger a reading on my IO link sensor every .5 s, and use that value to run a...
Replies
1
Views
517
Hello Everybody, Someone must be familiar with Horner Cscape, I wrote a program on a overhead door with a 3 button station,I'm working on a...
Replies
2
Views
1,387
personally I don't care about golf - but this is one impressive shot ... if it weren't on tape, I wouldn't have believed it ... the first video in...
Replies
1
Views
1,490
Back
Top Bottom