Reading and Writing Strategies
The OPC Router retrieves values from an OPC server in three ways: from its own cache, via an active connection to the server, or by reading directly during each transfer. The method used determines how up-to-date a value is in the transfer and how much load is placed on the network and the OPC server.
This setting is configured for each connection via the “OPC Read Mode” property in the “Advanced” tab of the OPC UA connection or the classic OPC connection. The setting does not apply to all objects in the connection—the overview shows which transfer objects and triggers follow this setting.
The three operating modes
OPC Router Cache
The data points are registered with the OPC server and are updated in the background. The transfer retrieves the most recently received value from the OPC Router’s cache and does not access the server for this purpose.
- Minimal network load, shortest transfer time.
- The value is at most as current as the last background update. If values change frequently, an outdated value is transferred.
Asynchronous
The data points are registered, and the server reports value changes on its own initiative. Read requests do not block the transfer; multiple read operations are processed in parallel.
- More up-to-date values than those in the cache, without having to wait for each individual response.
- With many data points and a high rate of change, the change notifications create a sustained load.
Synchronous
The data points are read directly from the OPC server during each transfer. The OPC Router registers them without continuous updating and reads them only when the transfer requires them.
- Highest up-to-date status.
- Highest network and server load, longest transfer duration.
Default setting
| Connection | Operating Mode |
|---|---|
| newly created | Synchronous |
| inherited from a configuration without this setting | OPC Router Cache |
Which object follows which operating mode
Transfer Objects
| Transfer Object | Follows the setting | Operating Mode |
|---|---|---|
| OPC Data Access | ✅ | Reads according to the set operating mode. |
| OPC Dynamic Read | ✅ | Reads the data points passed at runtime according to the set operating mode. |
| OPC Dynamic Write | – | Writes only. |
| OPC Structures | partially | Reads the structure node directly with every transfer. In “OPC Router Cache” mode, it instead uses an existing trigger value. |
| OPC Message | – | Fixed sequence via the change counter. Response data points are only accepted once the same value has been read twice. |
| OPC Methods | – | Calls an OPC UA method and does not read any data points. |
| Multiple OPC Read | – | Always reads directly from the server, even if the connection is set to “OPC Router Cache” or “Asynchronous.” |
| OPC Batch Read | – | Always reads directly from the server, even if the connection is set to “OPC Router Cache” or “Asynchronous.” |
| OPC HA Read | – | Reads from the historian. The type of access is determined by the transfer object itself. |
Triggers
No trigger is determined by the “OPC Read Mode” setting. Each trigger monitors its data points in the manner specified for it.
| trigger | If the settings are | Operation |
|---|---|---|
| Bit Triggers | – | Cyclically queries trigger and response data points. A value is accepted only after it has been read twice with matching results. |
| Threshold triggers | – | Reports the data point asynchronously and checks the threshold value cyclically. |
| Data Change Missing Trigger | – | Reports the data point asynchronously and monitors whether a change occurs within the set time. |
| Data-Change Trigger | – | Reports the data point asynchronously; the server reports every value change. |
| Multi-Data-Change Trigger | – | Creates separate subscriptions for the identified data point group. |
| Message Triggers | – | Cyclically queries the count data point. A value is not accepted until it has been read twice with matching results. |
| Alarm/Event Triggers | – | Subscribes to events from the OPC UA server and does not read any data points. |
Triggers and Transfer Objects Working Together
When a trigger initiates a flow, the value of the triggering data point is already available. Whether a transfer object adopts this value depends on the operating mode:
- OPC Router Cache: The transfer object adopts the value from the trigger event, provided that the trigger and the transfer object use the same connection and the trigger has already read the data point.
- Asynchronous and Synchronous: The transfer object reads the data point again. If the value changes between the trigger and the transfer, the transfer sends the newer value—not the one that triggered the trigger.
If a transfer is to transmit exactly the value that triggered it, select the “OPC Router Cache” mode or use the trigger value directly as the flow’s input value.
Writing
The “OPC Read Mode” setting does not apply to writing. The “Enable Asynchronous Writing” property of the connection is decisive:
| Setting | Behavior |
|---|---|
| Disabled | The transfer waits for confirmation from the OPC server. A write error affects the transfer. |
| Enabled | The write request is sent without waiting for confirmation. The transfer continues; feedback regarding success or failure is decoupled from the transfer in terms of timing. |
Other Settings That Affect Behavior
| Settings | Effect |
|---|---|
| “Read Max Age” (OPC UA only) | Specifies the maximum age of a value that the OPC server is allowed to return from its own cache. This setting applies to the server, not to the OPC Router. See OPC UA plug-in. |
| “Register OPC Tags on Startup” (OPC UA only) | Registers the data points as soon as the connection is established, rather than waiting until the first transfer. This prevents the first transfer from being delayed by the registration process. However, the plug-in instance may take a little longer to start up. |
| “Sample Rate” | Login polling rate. This determines how up-to-date a value can be in the “OPC Router Cache” and “Asynchronous” modes. |
| “Allowed Qualities” | Determines which quality states the OPC Router accepts. See OPC Qualities and Status Codes. |
Selecting the Operating Mode
| Requirement | Method |
|---|---|
| The transfer must transmit the machine’s current value (job data, measured values at the time of transfer). | Synchronous |
| The transfer should transmit exactly the value that triggered the event. | OPC Router Cache |
| Many data points are transmitted cyclically, and a delay of a few seconds is not critical. | OPC Router Cache |
| Many data points are read, and the transfer should not wait for every response. | Asynchronous |
Typical Observations
| Observation | Cause |
|---|---|
| The transmitted value is older than the value on the machine. | “OPC Router Cache” mode, or the polling rate of the connection is too high. |
| The transmitted value differs from the trigger value. | "Asynchronous" or "Synchronous" mode: The transfer object reads the data point again. |
| The load on the OPC server increases significantly with each transfer. | "Synchronous" mode, or a transfer object that always reads directly (Multiple OPC Read, OPC Batch Read). |
| Switching to “Synchronous” does not change anything. | The transfer object being used does not follow these settings—see overview. |