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:

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:

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:

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

  • MemberA(INT)

  • MemberB(INT)

  • MemberC(INT)

  • MemberD(INT)

  • MemberEnd(INT)

StructureA

  • MemberA(INT)

  • MemberB(INT)

  • MemberC(INT)

  • MemberD(INT)

  • MemberE(INT)

  • MemberEnd(INT)

StructureA

  • MemberA(INT) [1]

  • MemberB(INT) [2]

  • MemberC(INT) [3]

  • MemberD(INT) [4]

  • MemberEnd(INT) [5]

StructureA

  • MemberA(INT) [1]

  • MemberB(INT) [2]

  • MemberC(INT) [3]

  • MemberD(INT) [4]

  • MemberD(INT) [5]

  • MemberEnd(INT) [0]

Parameters for module: