New to Step7

mosama

Member
Join Date
May 2009
Location
Egypt
Posts
182
Hello every one.

I'm new to Step7, so I'll need your help with some problems.

What is the difference between variables defined in the symbol table and any variable defined in TEMP folder ?

temppc.png
 
Kalle is right, and in brief - temp variables are not stored from scan to scan, whereas data in the symbol table or a DB is. Only use temp data for calculations or functions internal to any FB or FC. And one other restriction - don't use temp data fro one shot bits, this is a common beginner's mistake!
 
Thanks for your replies. I have another question.

I'm coming from the world of Unity Pro, so i can't understand the difference between function and function block, and why DB needs to be associated with FB. What is meant by "FB is a function with a memory which is DB"? Why I can't assign values directly to the FB without DB?

Sorry for too long question.
 
I used temp data for one shot bit and it worked well:

Temp data in OB1 is a special case because it is the block that calls all other blocks so it's local data cannot be used by other functions. The advice still stands though,

DO NOT USE TEMP DATA FOR STORING DATA BETWEEN SCANS
 
Retrieve the attached library and copy the blocks to your project, download to your plc and try your test again.
 
Temp data in OB1 is a special case because it is the block that calls all other blocks so it's local data cannot be used by other functions. The advice still stands though,

DO NOT USE TEMP DATA FOR STORING DATA BETWEEN SCANS

^^ Mr. D is correct. OB1 is a special case, the same rung of code will not work in a FB or FC (try it and see), and it's bad practice to mess with the temp data created with OBs (they may need to be regenerated at some point).
 
The Temp area is one big memory area that gets allocated to blocks when they are called. If your program call strucure is such that a new area is allocated each time, the temp area will retain data between calls. As your call strucure becomes more complex, eventually two different blocks will end up using the same temp area thus changing the behaviour of blocks.

Have you checked the behaviour of the blocks in Post#9?
 
Last edited:
icon13.gif
Man, listen to this or please never program a macine in Step7:

Until you have understood the differences between temporar and static variables you shold make ALL YOUR CODE IN FB'S AND NEVER USE TEMP VARIABLES.


If you don't believe me, make several calls of your fatal FC and see if it still works as you think.

Kalle
 
Ok thank you.

Another question: how to split the program to many sections like unity pro or cx-programmer?

KalleOlsen: Man, listen to this or please never program a macine in Step7

I think you can give your advice in a different manner!!!!!

 
Last edited:
What you tried to do could be dangerous if used on real equipment. Many here has tried to convince you, now at last it seemed to work.
:p

I posted you a link to Siemens training sites. If you bother to look it up, you could learn a lot.

Kalle
 

Similar Topics

is there any free trial version available for step7 professional and wincc comfort v17. i searched and downloaded TRIAL Download STEP 7...
Replies
1
Views
100
Hello. I need your help. I work at STEP7. There are two CPU 317-2 PN/DP controllers (317-2EK14-0AB0), working on PROFIBUS, as Master (CPU_1) and...
Replies
6
Views
205
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
194
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
173
Hello Inside a FB, I´m trying to transfer a string from a DB to a IN_OUT var that was define as a UDT. The problem is that i can´t determine the...
Replies
4
Views
177
Back
Top Bottom