Allow compatible structural extensions
Enables the reading and writing of changed (extended) structures despite deviations in the PLC project and in the VisiWin project without error messages.
In principle, the structures in the VisiWin project and in the PLC project must match 100% to ensure error-free communication. VisiWin issues an error message for every deviation in the structures. If the structures in the PLC project are changed, e.g. if a variable is added, then this structure must also be adapted accordingly in the VisiWin project. However, some development processes require the PLC project to be updated more frequently than the visualisation project.
With the parameter Allow compatible structure extensions, VisiWin from version 2022-1 (for runtime versions 7.2 from SP13 and 7.3) offers the option to realise this scenario. If the parameter is activated, certain deviations in the VisiWin structures are tolerated and no error messages are issued. These deviations are considered "compatible" for VisiWin. Which deviations are compatible and which are not is explained below.
To ensure that the structures on the PLC side and visualisation side do not develop too far apart over time and lead to problems in communication, the visualisation project should be adapted to the structures of the PLC at regular intervals. This means that the variables of the OPC UA channel should be imported again.
The following statements regarding the occurrence or non-occurrence of error messages only apply if the parameter Automate individual accesses to structural elements is deactivated (default setting). The corresponding error messages are logged in VWEManager.log and a system alarm is triggered at the same time, which can be displayed in the alarm control elements in the application.
Compatible extensions
If the Allow compatible structure extensions parameter has been activated in the project, no error messages are issued for compatible extensions, reading and writing these structures is possible and the VisiWin project does not need to be adapted.
The following structure extensions in the PLC project are considered compatible:
- Additional members at the end of a structural levelexample:
MemberBN and MemberN have been added in the updated PLC project. If the Allow compatible structure extensions parameter is activated, no error message is issued.
PLC structure
VisiWin structure
New structure SPS
StructureA
MemberX
SubstructureB
MemberBX
MemberBY
MemberY
MemberZ
StructureA
MemberX
SubstructureB
MemberBX
MemberBY
MemberY
MemberZ
StructureA
MemberX
SubstructureB
MemberBX
MemberBY
MemberBN
MemberY
MemberZ
memberN
-
Different field lengths/sizes
Example:
MemberY has a field size of 3 in the VisiWin project and a field size of 4 in the updated PLC project (i.e. there is an additional variable). If the Allow compatible structure extensions parameter is activated, no error message is issued. This also applies if memberY has one less variable in the new PLC structure, e.g. a field size of 2.
SPS structure
VisiWin structure
New SPS structure
StructureA
-
MemberX
-
MemberY[3]
-
MemberZ
StructureA
-
MemberX
-
MemberY[3]
-
MemberZ
StructureA
-
MemberX
-
MemberY[4]
-
MemberZ
-
Non-compatible extensions
There are extensions that are not compatible and make it necessary to adapt the VisiWin project.
Incompatible extensions that are recognised and lead to an error message:
-
New member instead of another (different name)
Example:
MemberZ is not found, an error is generated.
SPS structure
VisiWin structure
New SPS structure
StructureA
-
MemberX
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
MemberY
-
MemberN
-
-
New member instead of another (different data types that cannot be converted into each other)
Example:
INT cannot be converted to DATE, an error is generated.
SPS structure
VisiWin structure
New SPS structure
StructureA
-
MemberX
-
MemberY(INT)
-
MemberZ
StructureA
-
MemberX
-
MemberY(INT)
-
MemberZ
StructureA
-
MemberX
-
MemberY(DATE)
-
MemberZ
-
-
Missing members in the OPC UA server
Example:
In example 1, memberBY is missing from substructureB in the PLC. In example 2, memberY is missing in structureA. An error is generated in each case.
SPS structure
VisiWin structure
New structure PLC (example 1)
New structure PLC (example 2)
StructureA
-
MemberX
-
SubstructureB
-
MemberBX
-
MemberBY
-
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
SubstructureB
-
MemberBX
-
MemberBY
-
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
SubstructureB
-
MemberBX
-
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
SubstructureB
-
MemberBX
-
MemberBY
-
-
MemberZ
-
-
Additional members at the beginning or within a structure
Example:
MemberM and MemberN have been added to the PLC structure. An error is generated in each case.
SPS structure
VisiWin structure
New SPS structure
StructureA
-
MemberX
-
MemberY
-
MemberZ
StructureA
-
MemberX
-
MemberY
-
MemberZ
StructureA
-
MemberM
-
MemberX
-
MemberN
-
MemberY
-
MemberZ
-
-
Missing structure member in VisiWin. The values could be assigned incorrectly!
Example:
MemberC is missing in VisiWin. VisiWin requests the values from structure A, the assignment is based on the order of the transferred values. Names are not checked.
PLC structure [example values]
VisiWin structure [example values]
StructureA
-
MemberA(REAL) [1.3]
-
MemberB(REAL) [2.2]
-
MemberC(REAL) [3.7]
-
MemberD(REAL) [4.5]
-
MemberE(REAL) [9.7]
StructureA
-
MemberA(REAL) [1.3]
-
MemberB(REAL) [2.2]
-
MemberD(REAL) [3.7]
-
MemberE(REAL) [4.5]
-
However, there are incompatible extensions that are not recognised, i.e. they do not lead to error messages. It is possible to read and write these structures, but they can lead to incorrect data being assigned! In these cases, the VisiWin project must also be adapted.
Incompatible extensions that are not recognised and do not generate error messages:
-
Members of the same data type that are swapped in the sequence. The values are assigned incorrectly. The problem of a swapped value is the case when writing complete structures, but not when writing individual structure elements.
Example:
MemberZ and MemberY are swapped in the new PLC structure. The values are transferred to VisiWin based on their order and assigned incorrectly.
SPS structure
[Example values]
VisiWin structure [example values]
New structure PLC [example values]
VisiWin structure [example values]
StructureA
-
MemberX(REAL) [1.2]
-
MemberY(INT) [42]
-
MitliedZ(INT) [87]
StructureA
-
MemberX(REAL) [1.2]
-
MemberY(INT) [42]
-
MitliedZ(INT) [87]
StructureA
-
MemberX(REAL) [1.2]
-
MemberZ(INT) [87]
-
MemberY(INT) [42]
StructureA
-
MemberX(REAL) [1.2]
-
MemberY(INT) [87]
-
MitliedZ(INT) [42]
-
Solution for recognising extended structures in the PLC
If a structure extended at the end is described in the PLC as a complete structure from VisiWin (i.e. the Automate individual access to structure elements parameter is deactivated for this structure), VisiWin overwrites the variables in the PLC that are not present in the VisiWin structure with 0 or, in the case of strings, with an empty string. The PLC can be programmed so that it checks whether the last element is set to 0 and indicates in a corresponding error message that the structure in the visualisation is not complete.
Example:
In the controller, structureA contains an end element (memberEnd). In the new PLC structure, a further element is inserted before the end element (memberE). The structure is completely described from VisiWin. VisiWin recognises that the new PLC structure is longer than the one defined in VisiWin and fills the last element with the value 0. The PLC in this example is programmed in such a way that the end member must never be zero. The PLC therefore recognises that the structure described from VisiWin does not match its own and responds with an error message.
|
SPS structure |
New SPS structure |
VisiWin structure [value written] |
Structure PLC [value new] |
|---|---|---|---|
|
StructureA
|
StructureA
|
StructureA
|
StructureA
|
Parameters for module: