FB_OpcUaServer_SetServiceLevel

The TwinCAT OPC UA Server currently sets the ServiceLevel statically to the value 255. This function block enables the ServiceLevel to be set via an ADS interface in the server. A distinction is made between use with and without a watchdog.
Further information on the service level can be found in the ServiceLevel Documentation of the TwinCAT OPC UA Server.
Syntax
FUNCTION BLOCK FB_OpcUaServer_SetServiceLevel
VAR_INPUT
tAmsNetId : T_AmsNetId := '127.0.0.1.1.1';
tTimeout : TIME := T#5s;;
bExecute : BOOL;
bWatchdog : BOOL;
nServiceLevel : BYTE;
END_VAR
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrorId : UDINT;
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
tAmsNetId | T_AmsNetId | AmsNetId of the system on which the TwinCAT OPC UA Server runs. If no information is provided, the local host is used. |
tTimeout | TIME | Maximum time for executing the ADS command. The setting is 5 seconds by default. |
bExecute | BOOL | Optional parameter to specify a URI for the WebSocket opening handshake. |
bWatchdog | BOOL | Determines whether the ServiceLevel is set with or without a watchdog. |
nServiceLevel | BYTE | ServiceLevel that is set in the TwinCAT OPC UA Server. |
Outputs
Name | Type | Description |
|---|---|---|
bBusy | BOOL | Is TRUE as long as the function block is busy with processing. |
bError | BOOL | Becomes TRUE when an error situation occurs. |
nErrorId | UDINT | ADS error code. |
Requirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT v3.1.4026.x | IPC or CX (x86, x64, Arm®) | Tc3_OpcUa (1.1.8 or higher) |