Clarifying how the PLC scan works..

Johnny T

Member
Join Date
Jul 2003
Location
Fife, Scotland
Posts
642
I have read that the PLC scan in S7 has four stages. It scans an image of all the inputs. Then it processes the code inbetween the inputs and outputs. Then it writes the output image to the PLC and finally it does a Self Check (internally checking its hardware etc) before starting the procedure again.

If I had a Function with say 20 lines of ladder in it. Does it scan all the FC first to establish which inputs are on. Then process any MOVE instructions or maths instructions etc, then write any outputs that need turning on?

Or does it do it line by line. So scan the FC as you would read a book??

Also, do all PLC's scan the same, or does it vary between manufacturers?
 
Johnny T - the following description may exist elsewhere, but here is my attempt to clarify things for you. Things can get more complex, but lets just peel one layer of onion at a time.

Scanning the inputs means reading the state of all input modules that are allocated space in the Process input and copying their states into the Process input image area (PII). This scanning process has nothing to do with any program. The PII is a memory area that programs access. The program executes and writes data to the process output image (POI) memory area. When all program has finished executing, the POI is copied to all output modules allocated space in the Process output image area - this is when the outputs will change state.
 
Simon.. I see. So the PII and POI are nothing to do with the program as such. They are simply a software representation of the current state of the hardware.

OK, that's cleared that up.

Next question is how the PLC actually reads the program. Does it read it like a book one line at a time or does it read in all the "inputs" and then write all the "outputs".

Cheers

JT :)
 
He wants to know how the program itself is "read"...ie left to right, top to bottom...which is how its done in most plcs. I think Modicon is an exception.

plc2_3_1.gif
 
Simon, in the following code..

 

I1.0 M10.0 Q1.0
--| |-----|/|------( )

I1.0 M10.0
--| |--------------( )



As the PLC reads this.. does it say.. right I1.0 is on for both rungs. Then M10.0 is off... Then I'll process the outputs so Q1.0 is on and M10.0 is on. Next scan.. I1.0 is still on for both rungs. M10.0 is now on. So (writing my outputs) Q1.0 is off, M10.0 is still on.

Or does it read it like a book. ie. I1.0 is on, M10.0 is off, bring on Q1.0... next line.. I1.0 is on, M10.0 is on... next scan... I1.0 is on, M10.0 is on, Q1.0 is off... next line.. I1.0 is on, M10.0 is still on.. next line etc...

So (I'm not explaining myself very well am I?) does it read in all the inputs.. then do the middle bit of the process, then write all the outputs. Or does it do it sequentially?

Hope you understand my poor attempt at explaining it..

:)
 
Johnny in your example Q1.0 will be on for one scan, it reads the inputs, executes the program then sets the outputs. Since M10.0 is NOT on during first scan time then Q1.0 will be turned ON as will M10.0. The next scan M10.0 is on so Q1.0 will turn off. That is the basic programming for a oneshot.

Like this...I had to read it a couple of times
As the PLC reads this.. does it say.. right I1.0 is on for both rungs. Then M10.0 is off... Then I'll process the outputs so Q1.0 is on and M10.0 is on. Next scan.. I1.0 is still on for both rungs. M10.0 is now on. So (writing my outputs) Q1.0 is off, M10.0 is still on.
 
Johnny, it does it the second way you decribe it. In fact, switch the representation to STL and you'll exactly how the instructions are processed.

Also, although it's a minor point, the scan works like this: The output tsble is written to the outputs, the inputs are copied to the input table, and then the code is executed. It used to be different, but Siemens changed it a few years ago.
 
S7 is correct on newer 300/400s how they scan but I still believe that code should act like a one shot...or would have but I dont have a 300/400 to test with.

s7scan.jpg
 
Ahhh.. didn't realise it had been changed. That's probably where my confusion is coming from.

Thanks, as always, for the replies guys... much appreciated.

(y)
 

Similar Topics

Hello to all, I'd like to start a topic in which often used terms can be explained. English is not my native language, so I have hard time...
Replies
5
Views
2,409
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
0
Views
21
I know this topic has been brought up a few times, but i had some specific questions. I have installed several 1783-NATR devices and they have...
Replies
0
Views
47
Hello We have installed several G.E. Fanuc 90 70 PLC Everything was ok but suddenly we can not communicate anymore with any PLC with the software...
Replies
0
Views
33
Apologies for not being the best IDEC programmer. I recently was doing some inspections on a site that had 3 FC6A IDEC processors. The issue is...
Replies
0
Views
51
Back
Top Bottom