OpcUaWriteValue – Write value to OPC UA Server

Block SymbolLicensing group: ADVANCED
PIC

Function Description

This function block depends on the OpcUa driver. Please read the OpcUaDrv manual [12] before use.

The OpcUaWriteValue block writes value to the OPC UA Node through a connection established by the OPC UA client driver.

The first two parameters are NodeId and NodeId_type. The NodeId_type specifies what type of information it is expected to be entered as the NodeId parameter. If the value is string, numeric, guid than the NodeId parameter should contain the id of the actual OPC UA Node on the server prefixed with the index of the namespace declared in the configuration of the driver separated by a colon (e.g. 1:myNode).

If the value of the NodeId_type parameter is set to path than the NodeId parameter should contain the path to the desired Node in the server structure. Every segment of the path is composed from the attribute BrowserName of the node and the BrowserName is similarly with regular NodeId types prefixed with the index of the namespace declared in the configuration of the driver separated by a colon (e.g. /1:myDevice/1:myNode). The path is relative to the Objects folder in the OPC UA server structure.

The parameter type specifies the expected Node’s value data type. The input signal value is converted to the specified type and is than written to the Node’s value attribute.

When the process of writing the value is finished the result code defined by OPC UA is set to the code output and it’s textual representation is set to the status output.

Inputs

value

Input signal

Unknown

WRITE

Enable execution

Bool

Parameters

NodeId

OPC UA Node Id

String

NodeId_type

Type of Node ID  1

Long (I32)

1 ....

string

2 ....

numeric

3 ....

guid

4 ....

path

type

Value data type  1

Long (I32)

1 ....

string

2 ....

double

3 ....

long

4 ....

bool

Outputs

BUSY

Busy flag

Bool

DONE

Indicator of finished transaction

Bool

errId

Error code

Error

code

OPC UA result status code

DWord (U32)

status

OPC UA result status string

String

2022 © REX Controls s.r.o., www.rexygen.com