ServiceLevel
The ServiceLevel provides a client with information about the state of a server and its ability to deliver data. The ServiceLevel is a node of the byte data type with a value range from 0 to 255. A high value stands for high availability or quality of service, a low value for limited availability.
Clients can use the ServiceLevel to evaluate the current state of a server or to compare servers in redundant or distributed environments. The ServiceLevel is to be understood as a general status indicator and does not replace a detailed diagnosis of individual error causes.
The TwinCAT OPC UA Server currently sets the ServiceLevel statically to the value 255. It is also possible to influence the ServiceLevel of a TwinCAT OPC UA server via an ADS interface in the server. The function can be used either with or without a so-called watchdog.
With watchdog monitoring
The written ServiceLevel must be written again cyclically within the configured timeframe. If there is no update, a configured fallback value is automatically set. The function block FB_OpcUaServer_SetServiceLevel is used for that.
In the context of the watchdog, the two configurable values are:
Setting | Meaning |
|---|---|
ServiceLevelWatchdogTimeout | This is the amount of time in ms after which the watchdog is triggered if the ServiceLevel has not been submitted to the server again. |
ServiceLevelWatchdogFail | This is the value to which the ServiceLevel is set when the watchdog encounters a timeout. |
Without watchdog monitoring
The written ServiceLevel is set once by the function block FB_OpcUaServer_SetServiceLevel. Any active watchdog is deactivated. The value is retained until it is changed by another write access. If the watchdog is to be reactivated, the method must be executed again with watchdog monitoring.