QUESTION:
How are the variables stored in the temporary local data?
ANSWER:
The L-stack addressing always starts with Address 0
Exactly the same number of bytes are reserved on the L-stack
for each block as the number of bytes of static or local data
that each block has.
When a block is terminated, then its space is released again.
The pointer always indicates the 1st byte
of the currently open block.
Example:
| Run level
| L-stack in bytes | Pointer
|
| Call OB1 (with 20 static [fixed] and 10 additional bytes of local data)
|
30 |
0 |
| Call FC1 (with 30 bytes of local data)
30 bytes (OB1) +30 bytes (FC1)
|
60 |
30 |
| Call FC10 (with 20 bytes of local data)
60 bytes (OB1 + FC1) +20 bytes FC10
|
80 |
60 |
| Call FC11 (with 20 bytes of local data)
60 bytes (OB1 + FC1) +20 bytes FC11
|
80 |
60 |
| Call FC12 (with 30 bytes of local data)
60 bytes (OB1 + FC1) +30 bytes FC12
|
90 |
60 |
| Call FC2 (with 50 bytes of local data)
30 bytes (OB1) +50 bytes (FC2)
|
80 |
30 |
| Call FC20 (with 10 bytes of local data)
80 bytes (OB1 + FC2) +10 bytes FC20
|
90 |
80 |
| Call FC21 (with 10 bytes of local data)
80 bytes (OB1 + FC2) +10 bytes FC21
|
90 |
80 |
| Call FC22 (with 20 bytes of local data)
80 bytes (OB1 + FC2) +20 bytes FC22
|
100 |
80 |
| Call FC221 (with 10 bytes of local data)
100 bytes (OB1 + FC2 + FC22) + 10 bytes FC221
|
110 |
80 |
The L-stack is used by the CPU for internal processing. The STL
editor itself also uses bytes of local data, e.g. in transferring
parameters for a block call.
Therefore, do not change the contents of the L-stack.
Note:
256 bytes per priority class are provided per program processing
level (run level).
- for S7-300, fixed
- for S7-400, usually can be set under CPU Properties
in the hardware configuration.
|