One Scan Question

dbh6

Lifetime Supporting Member
Join Date
Jan 2013
Location
Central, NJ
Posts
552
So this just occurred in my head. Say you have a XIO then in series have a ONS function then have your output coil. So now when you run your program, if your input goes true the ONS looks for a false to true transition then your output coil is ON for one scan.

So my questions is, what is really one scan?? So in this scenario, is one scan defined as the point when the output goes true till the end instruction or is one scan defined as the point when the output goes true up until the PLC goes to the end instruction, scans again and arrives back at that output coil and is that considered one scan??


This question is based on a SLC 5/04, but i think in theory it applies to most plc's. Comments are appreciated.
 
These are computer instructions. The instruction will write to an address in memory and that value will then stay in memory until that instruction is executed again to write some different value to memory. As long as no other instruction writes to the memory address then the value doesn't magically change.

Hope that helps.
 
Destructive instructions is the key as Troy points out. My short reply earlier was right when the bell rang on my pizza timer.

Note that the preceding inline oneshot instruction is also destructive operating on its own storage bit and determining the true/false operation of the OTE or output coil instruction.
 

I:0/0 B3/0 O:0/0
---| |---------------------|\|----()---
| B3/0
|---------()---



Here is a way to make your own One shot... During the first Scan where I;0/0 is On. B3/0 is Off O:0/0 is On. On the next Scan B3/0 is On so O:0/0 is turned off, until the rung is reset.
 
@ brijm nice! that actually demonstrates that up until it comes back to the same point to reevaluate the status of the b3/0 bit thanks.
 
Brian's example is actually a really good illustration of how the ONS instruction works internally. In his example a ONS with a storage bit of B3/0 does essentially the same thing as is shown on the ladder; ONS just provides a nice shorthand for programming the function.
 
suggestion: do NOT read this post ... turn around – and just slowly – slowly walk away ...

couldn't resist? ...

the potential for mischief is that certain "go-to-run" conditions can make various One-Shot type instructions act differently ... even if we stay entirely within the Allen-Bradley brand processors – there can still be a LOT of variations ...

(1) PLC-5 and ControlLogix/CompactLogix platforms handle their "in line" ONS instructions one way during PRESCAN ...

(2) SLC-500 and most MicroLogix systems use an OSR for their "in line" One-Shot type instructions ... these are handled another way during PRESCAN ...

(3) the MicroLogix 1500 uses an ONS for its "in line" One-Shot type instruction ... the "book" says that this ONS is handled like the ONS in the larger platforms at PRESCAN – but the book is wrong ...

(4) the roll-your-own One-Shots might work PERFECTLY (indeed in certain cases they sometimes work better than the "offical" One-Shots) but the fact is that they can act differently during PRESCAN ...

(5) and so on ...

unexpected results can occur – and "unexpected" is always a bad word to a programmer ...

suggestion:

what-EVER approach you finally decide to use for your One-Shot action – test it under every conceivable "go-to-run" scenario that you can image ...

a few examples:

(6) the input/switch/sensor was ON when a power failure occurred ... the input/switch/sensor stayed ON when the system was powered back up ...

question: did the One-Shot work as expected? ...

(7) the input/switch/sensor was OFF when a power failure occurred ... the input/switch/sensor was ON when the system was powered back up ...

question: did the One-Shot work as expected? ...

(8) and so on ...

in normal day-to-day operations, most programmers don't worry about things like this ... but these are "beyond beginner" issues that can cause:

(9) boxes on a conveyor line to intermittently "skip" being counted ...

(10) barcode labels to intermittently be applied to the "wrong" boxes ...

(11) serial numbers to intermittently get "out of sequence" ...

(12) machines to intermittently crash when a robot tries to insert an "extra" pin into a hole ...

(13) and so on ...

most people just blame intermittent issues like this on "the power surge" associated with the power failure – but in some (many?) cases, the issues were actually predictable based on the way the One-Shots were programmed ...

party on ...
 
Last edited:
@ Ron, i agree with what you mentioned, i have looked at your videos and did all your practice problems on your website, it has changed my views on PLC's, so kudos for that. I understand that the go-to-run can be an issue which can none other be resolved by testing the "what if" scenarios, so like you mentioned i will test the code in those scenarios and go with the ons which best works.
 
Greetings dbh6 ...

thank you for your kind compliments – I'm glad that I've been helpful ...

let me just say that my latest post was not directly addressed specifically to YOU – but also to the many other readers who will no doubt come across this thread in the future ...

my purpose in writing was to make them aware that there is (as usual) more to the story – and that "one size fits all" is usually not a realistic approach ...

thank you for accepting my comments in the spirit with which they were written ...
 

Similar Topics

Hello! I have a question about a routine I found on one of our box palletizing machines. I've attached the 3 rungs that I have the question...
Replies
12
Views
2,325
Hi. I'm a beginner at programing and my question is about the MOV instruction at RSLOGIX. First of all I dont have any practicals issues with...
Replies
8
Views
3,383
This should be a pretty easy question, would just like to have it explained a bit so I can understand it. In the attached program, why does the...
Replies
15
Views
4,707
I have a question about differences in logic solving output instructions when they are placed in series as opposed to parallel. Getting down to...
Replies
23
Views
5,092
I have a 10ms periodic task (in ladder logic) set up in my Logix controller (v28.) One of my routines is to MOV the decimal number "2" into a...
Replies
7
Views
2,439
Back
Top Bottom