FB_OpcUAServerGetStatus

FB_OpcUAServerGetStatus 1:

The function block enables the current status (Running, NotResponding) of a TwinCAT OPC UA Server to be read. It should be noted at this point that this function block deals with the ADS interface of the OPC UA Server. If the OPC UA Server is restarted or shut down, the ADS interface of the server remains accessible. The ADS interface can only be closed by terminating the server process.

Syntax

Definition:

FUNCTION_BLOCK FB_OpcUAServerGetStatus
VAR_INPUT
    sNetId             : T_AmsNetId;
    bGetStatus         : BOOL;
    tTimeout           : TIME;
END_VAR
VAR_OUTPUT
    eOPCUAServerStatus : E_OPCUAServerStatus;
    bDone              : BOOL;
    bBusy              : BOOL;
    bError             : BOOL;
    nErrorId           : UDINT;
END_VAR

FB_OpcUAServerGetStatus 2: Inputs

Name

Type

Description

sNetId

T_AmsNetId

AmsNetId of the system on which the TwinCAT OPC UA Server runs.

bGetStatus

BOOL

A rising edge activates processing of the function block.

tTimeout

TIME

ADS Timeout

FB_OpcUAServerGetStatus 3: Outputs

Name

Type

Description

eOPCUAServerStatus

E_OpcUAServerStatus

Contains status information about the server.

bDone

BOOL

TRUE when processing of the function block is complete.

bBusy

BOOL

TRUE as long as processing of the function block is in progress.

bError

BOOL

Becomes TRUE as soon as an error situation occurs.

nErrorId

UDINT

Contains the error code when an error (bError) occurs.