Inheriting properties with structure datatypes and structure variables |
Manual -> Variables -> Inheritance concept -> Inheritance in zenon -> Inheriting properties with structure datatypes and structure variables |
Show all Hide all |
Structure variables are handled in the same way as simple variables. But the properties have to be set for every single structure element. Each element of a structure variable is linked to a structure element of the structure data type it is based on.
Additionally a structure element again can be linked to a data type.
So the structure variable element inhertis the properties from the structure element, which again can be linked to a data type.
It becomes even more complex, if structures are used in structures:
Variable with structure in structure
In the example the varibale is Motor.Drehzahl Regelung. Drezahl is deduced from the structure Motor. This again contains the structure element Speed Control, which again is a structure. This structure is linked to the structure Engine, as structures in structures can only be linked. In this structure Speed Control the data type INT is linked.
So if there are changes in this data type, these changes directly effect the variable Engine.Speed Control.Engine Speed Actual.
So be careful with changes in data types.
Overwriting properties or restoring the inheritance from the data type are done as described above.