8/9/2013 12:45 PM | |
Posts: 3609 Rating: (29) |
Import of a Technical Question of the user Ram krishan
|
8/9/2013 1:19 PM | |
Joined: 12/4/2009 Last visit: 5/3/2024 Posts: 452 Rating: (135) |
Ram krishan, every function, or fuction block, or even organisation block have some temp memory area reserved for user-specific manipulation and/or calculation. Size of local data stack depends on given CPU and can be adjusted in HW configuration. The reason why theese bits and bytes are not available to other functions is the core meaning of temp memory area: it is the part of memory reserved only for the fuction that is currently being executed. For this reason using temp variables makes only sence for one cycle calculations. If one wants data to be available to the other functions, or in the other cycle, FB with instance data block is to be used. It is actually the main difference between FC and FB: FC has no memory whatsoever, only temporary mem area. FB has it's own memory called instance data block, a place to store informations needed further in your user application. Usage is failry simple: in LAD/STL/FBD editor go to interface editor (upper in the screen), find TEMP area and insert some variables (bytes, bits, integers, ...). Use them in your code symbolically, just like any other variable. Do not forget the golden rule for TEMP variables: Hope this helps. Regards.
|
If this post actually helped, you may consider using the Rate button above. |
|
Follow us on