S7 prgram scan

Rack Failure

Member
Join Date
Jun 2003
Posts
44
Hi all,
I would appreciate if someone out there can clarify when Flags etc are update during scans.
I understand/believe that in S7, at the start of the scan of OB1, the status of the I/P's are mapped. As program is executed the status of O/P's are mapped but not updated until the end of OB1's scan.
Assuming this is correct, when are the Flags (eg M0.0) updated? Is it at time of execution or at end of OB1 scan?
Also in edge detection (one shot) when a Flag is on for one scan, is the Flag on during the scan of execution or is it the next scan.
Any further clarity in this area will be greatly appreciated.

Steveojavascript:smilie(';)')
wink
 
programe is

1 Input Scan
2 Logic Scan
3 Outputs
4 house keeping

in input scan all I0:0 anf flags get scaned
based on logic output gets drived


Thanks
 
when are the Flags (eg M0.0) updated? Is it at time of execution or at end of OB1 scan?
> at time of execution

Also in edge detection (one shot) when a Flag is on for one scan, is the Flag on during the scan of execution or is it the next scan.
>during the scan where the status differs from the previous scan cycle.

Polle
 
The state of I, Q and F (and DBX) can change many times during the program scan.
When you test one of these addresses, it is evaluated with the state it has at the particular time.
In this example F0.0 is set ON and then OFF:
  F0.0         F0.0
--|/|----------(S)

F0.0 F0.0
--||-----------(R)


Conversely, you can assign the state if Q, F and even I addresses many times during the same program scan. Yes, you can assign the logical state to I addresses.

For example:
  F0.0  I0.0   I0.1
--||----|/|----()


The special thing about I addresses is that their state (in memory) is written by the CPU before the program scan, based on the states of the hardware inputs.

The special thing about Q addresses is that the CPU reads their logical states (in memory) to turn on or off the hardware outputs after the main program scan.
 
(Quote:)
Also in edge detection (one shot) when a Flag is on for one scan, is the Flag on during the scan of execution or is it the next scan.

>during the scan where the status differs from the previous scan cycle.

The flag will be ON in the scan after the position of the oneshot instruction. And it will stay ON until it meets the same oneshot instruction in the NEXT scan.

If the oneshot instruction isnt executed in every scan, then it can happen that the output of the oneshot instruction stays ON for even more scans. It would be considered a programming error in most cases, but it CAN happen.
 
Hi
Thanks to all replies.
Jesper et al, in the LAD below, which is a single Input toggling on/off an Output.
At rung 1,when I0.0 is on, M5.0 detects the edge and turns on M0.0 for one scan.
At rung 2, M0.0 is now on, Q0.0 is off, therefore Q0.0 is now on.
In the parallel branch Q0.0 is now on but M0.0 which is ON requires M0.0 to be in an off state.So how does the parallel branch latch Q0.0 on when it requires M0.0 to be off?
It might seem straight forward to you but it aint to me.

I0.0 M5.0 M0.0
---| |-----|P|---------------( )

M0.0 Q0.0 Q0.0
---| |-----|/|---|------------( )
|
Q0.0 M0.0 |
---| |----|/|----|

Steveo
 
So how does the parallel branch latch Q0.0 on when it requires M0.0 to be off?

At the beginning of the Next scan Q0.0 will be true and M0.0 will be false (since it was a oneshot), it will latch the output on this scan.

So in simple terms, Q0.0 goes true on scan 1 and latches on scan 2.
 
Jesper, Ken
Much clearer now.
On the first scan when M0.0 is on, Q0.0 is switched on in the software. At end of first scan the outputs are updated, ie the physical output Q0.0 is switched on. On the next scan Q0.0 is on, M0.0 is now off, that path latches Q0.0 on until the next time M0.0 goes on again.

Cheers, Steveo
 
The real truth is input image, output image & flags are updated when executed in siemens the i/o table is the same as the memory bit table then the peripheral tables (true input/output) are updated outside the OB1 scan unless you force it with L PIW 0 T IB0
etc.
 

Similar Topics

Hello everyone my name is Mzolo, and I am a new guy I have a similar problem to dle.I just can not get the robot to respond to my signals. I...
Replies
0
Views
4,053
We are going to switch an electrolytic coatings stripper from Labview to a plc. We need tomonitor the voltage and current readings from the...
Replies
4
Views
1,891
I want the upload a program from one machine that have a FP0 PLC. But i have one problem the program is protected by a password. Is there a way...
Replies
8
Views
5,789
Dear all, We are using Siemens PLC S5 135U. I need to generate a digital output from an analog input, low set value and high set value. I know...
Replies
7
Views
2,324
Hello my name is gus and I'm trying to understand and write a program using Allen- Bradley PLC. The program is as follows: 1. When the start...
Replies
1
Views
4,516
Back
Top Bottom