FB_OpcUAServer

FB_OpcUAServer 1:

The function block enables status information to be read out and a TwinCAT OPC UA Server to be restarted.

Syntax

Definition:

FUNCTION_BLOCK FB_OpcUAServer
VAR_INPUT
    sNetId             : T_AmsNetId;
    bExecute           : BOOL;
    eOpcUAServerOption : E_OpcUAServerOption;
    tTimeout           : TIME;
END_VAR
VAR_OUTPUT
    stOpcUAServerInfo : ST_OpcUAServerInfo;
    bBusy             : BOOL;
    bError            : BOOL;
    nErrorId          : UDINT;
END_VAR

FB_OpcUAServer 2: Inputs

Name

Type

Description

sNetId

T_AmsNetId

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

bExecute

BOOL

A rising edge activates processing of the function block.

eOpcUAServerOption

E_OpcUAServerOption

Specifies the operation to be performed.

tTimeout

TIME

ADS Timeout

FB_OpcUAServer 3: Outputs

Name

Type

Description

stOpcUAServerInfo

ST_OpcUAServerInfo

Contains status information from the server when ServerInfo is selected at the eOpcUAServerOption input.

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.