Skip to content
Start free evaluation

pdcomm_opcua_server_set_value

Function

Writes the Value attribute of a variable as a local, authenticated user.

int32_t pdcomm_opcua_server_set_value(pdcomm_opcua_handle server, pdcomm_opcua_bytes node_id, pdcomm_opcua_bytes variant, uint32_t *out_status)

Declared in: #include <pdcomm/opcua/pdcomm_opcua.h>

The same rules as a client Write apply: the variable must be writable and the new Variant must have the same built-in type and array shape.

Parameters

NameDescription
serverServer handle.
node_idEncoded NodeId in namespace 2, at most 4096 bytes.
variantEncoded Variant, at most 4 MiB.
out_statusReceives the OPC UA StatusCode of the write, for example Good, BadNodeIdUnknown, BadNotWritable or BadTypeMismatch. It is BadInternalError when the call itself fails.

Returns

#PDCOMM_OPCUA_OK when the write ran (check out_status), #PDCOMM_OPCUA_INVALID_INPUT, #PDCOMM_OPCUA_CLOSED, #PDCOMM_OPCUA_BUSY, #PDCOMM_OPCUA_INVALID_HANDLE or #PDCOMM_OPCUA_POISONED.