Uploaded by gun.brown

BeneficialTipsonTemporaryVariablesTempinSiemensPLC-S7programming

advertisement
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/283153488
Beneļ¬cial Tips on Temporary Variables (Temp) in Siemens PLC-S7
programming
Research · October 2015
DOI: 10.13140/RG.2.1.3705.1605
CITATIONS
READS
0
3,329
1 author:
Shervin Ehrampoosh
Kettering University
12 PUBLICATIONS 34 CITATIONS
SEE PROFILE
All content following this page was uploaded by Shervin Ehrampoosh on 25 October 2015.
The user has requested enhancement of the downloaded file.
Shervin Ehrampoosh
Patti Engineering
Beneficial Tips on Temporary Variables (Temp) in Siemens PLC-S7 programming:
1- They can be used in all programming blocks, including Function Block (FB), Function (FC)
and Organization Block (OB).
2- Local Data Stack (L-Stack), which is only designed for the Temp, saves Temp variables data in
System Memory.
3- Although Temp is assumed as a temporary variable, data will not be erased after the execution of
the relevant block, including FB, FC or OB, because of the second tip. LOL
4- Access to the Temp variables is restricted when the relevant block, has not been executed.
5- Re-Running the CPU results in cleaning L Stack.
6- There are two types of Temp variables, Created by the System or the Programmer.
For example, #OB1_MIN_CYCLE refers to minimum cycle time for the OB1 in msec as an INT, as it
is shown in the first picture. We have a lot of different Systemic Temps on all OBs.
7- Static Variables (STAT) save in the relevant instance DB for FBs, which is a part of Load
Memory. In another words, STAT is only shown in Declaration Area of a FB.
8- There is only a specific L-Stack area for each OB Priority Class. It means that if there are a lot
of FBs or FCs called in OB1, the summation of all Local Data should be less than the MAX,
showed in CPU data sheet. This rule is not applied to Cyclic Interrupt OBs, OB3x.
9- In PLC-400, there is an option to manage memory area and assign it to each priority class.
View publication stats
Download