Instance data is stored in two formats
- A top level global block relating to data for a function block
- A structure of a function block’s type inside another global instance data block
Single Instance Data
A data block that contains Function Block Instance Data. This type of data block will exist in the Project Tree, as a “Top Level” object. This means that none of its data resides within another data block, however some other Function block instance data may exist with its own data
Everything within the function block is stored here. This includes the instance data for any other function block used.
Multi Instance Data
When a function block calls another function block, the data for the second one can be stored in the instance data of the first:
There are limitations to this, including size, nested depth and interface restrictions.
This approach is considered the most standard, and library conformant approach.
Mixing Instance Data Types
Its not possible to have instance data that doesn’t directly relate to a global instance block of some sort
However, you can call a global instance block from within another function block:
You should only really do this if you know that you won’t be reusing the parent block. This is because all instances of the parent block would also use the global data block, which means the second instance would overwrite the first
Accessing Instance Data
"Function_Block_Instance_Data".Function_Block_2_Multi_Instance.Input_Data_1
is accessing the Multi Instance Data for Function_Block_2_Multi_Instance
. Where as "Function_Block_2_Single_Instance".Input_Data_1
is accessing the same data point, but in the "Function_Block_2_Single_Instance"
Function Block, which is Single Instance Data
You can access instance data in the same way that you would access any global data. When working within a Function Block, accessing instance data works the same way as accessing any internal data.
It’s generally considered bad practice to be accessing instance data directly, especially from SCADA
In TIA Portal, the risks of accessing instance data are greatly reduced due to the symbolic nature of the environment.
I personally do not use instance data unless it’s within the confides of the same function block. My SCADA / HMI never accesses instance data.
Check Out Another Post
Difference Between Tags & Variables In Siemens TIA Portal
Apart from the obvious that one is a purple icon and the other is a blue, the difference between how…