robert_ Posted August 1, 2012 Report Posted August 1, 2012 (edited) Hi friends!, i have many doubts about FB's. of S7-300. I have doubts as to the static variables and temporary variables. Does using temporary variables is like loading data into the accumulator "AC0? And to use static variables is like putting data in the memory area VW or VD memory area as in s7-200?????? Edited August 1, 2012 by robert_ Quote
IamJon Posted August 1, 2012 Report Posted August 1, 2012 Basically, Temp are only used when the FB is running - internal data. Data in Temp tags are cleared when the function is exited. Stat data is saved to the DB which corresponds to your FB. If you open the corresponding DB, you will see your Stat tags listed there. These are saved and can be used after you exit the function. More info here: https://www.automation.siemens.com/NL/forum/guests/PostShow.aspx?PageIndex=1&PostID=19205&Language=en Quote
Groo Posted August 1, 2012 Report Posted August 1, 2012 Actually TEMP flags are not cleared when the Function or Function Block are exited. The Temp (L#, Local) flags are pulled off a local stack and remain in the last state. The area of local data used is not guaranteed, therefore the block could use the same area or a different area, also other blocks could use the same area. I've known people argue with me because their code was working fine when using TEMP's as retainers, it is possible for the block to use the same area and nothing else interfere, but there is no guarantee what works today will still work when 'Fred' adds a block. The golden rule with TEMP's is do not use the status until you have conditioned it, never rely on it as retained memory. Quote
robert_ Posted August 1, 2012 Author Report Posted August 1, 2012 thank you very much!!!, I get it Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.