Data consistency
A typical example of incorrect data consistency is the setting of a trigger that starts an action in the PLC and is also automatically reset there. In practice, this often leads to an error in the display and to the assumption that value changes are "swallowed up" by the visualisation.
Example: "Lost" values
| Actions (in chronological order) | Bit value | ||||
|---|---|---|---|---|---|
|
Control element |
Variable server |
OPC server (read cache) |
OPC server (write cache) |
PLC | |
| Initial state | 0 | 0 | 0 | - | 0 |
| Operator sets bit | 1 | 0 | 0 | - | 0 |
| Request is forwarded to variable server | 1 | 1 | 0 | - | 0 |
| Request is forwarded to OPC server | 1 | 1 | 0 | 1 | 0 |
| OPC server forwards request in write cache to PLC | 1 | 1 | 0 | 1 | 1 |
| PLC processes the action and sets the value back to 0 | 1 | 1 | 0 | - | 0 |
|
. . . |
|||||
| Final state: During the next read, the OPC server compares the read value with the value in the read cache, determines that no change has been made and does not send any further messages to the variable server. | 1 | 1 | 0 | - | 0 |
The process shown here corresponds exactly to the OPC specification with the requirement of a separate read and write buffer. In fact, INOSOFT processes a lot of support cases that show exactly this completely undesirable behaviour.
Remedies
- The manufacturer of an OPC server can violate the specification and install a connection between the write and read cache, i.e. it would have to transfer the changed value to the read cache after sending. However, such information cannot usually be seen from the data sheet and may have to be agreed with the manufacturer.
- Another possibility is to avoid exactly these constellations of writing to a variable on both sides. An incrementing counter that is sent to the PLC as a trigger may help. An acknowledgement from the PLC about the start or end of an action should be returned on another variable. Ultimately, data consistency comes at the cost of increased programming effort in the PLC and visualisation.