OPC UA Write
This function block sends a value to an OPC UA server address using the provided client connection. Use it to update remote variables from your scenario with a selectable data type.
π₯ Inputs
Client OPC UA client instance to use for the write operation (typically provided by the OPC UA Client block)
Node Address The target node address on the OPC UA server where the value will be written
Value The value to send to the target node
π€ Outputs
This function block does not provide outputs.
πΉοΈ Controls
Data type Dropdown to select the OPC UA variant type used when writing the value. Common selectable types include Float, Boolean, Integer variants, Double and String.
π¨ Features
Write with explicit data type selection so the target variable receives the expected type.
Works with an external OPC UA client instance to keep connectivity management separate.
Minimal UI: only requires the inputs and the data type selection for operation.
βοΈ Running mechanism
When the block is evaluated during a scenario run and the three inputs are provided, it will attempt to send the given Value to the specified Node Address using the supplied Client connection and the chosen Data type. Ensure the client is connected and the address is valid before running to avoid write failures.
π Usage instructions
Add and configure an
OPC UA Clientblock to establish and manage the server connection.Provide the client output into the
Clientinput.Set the target node address into the
Node Addressinput.Provide the data to write into the
Valueinput.Select the appropriate
Data typefrom the dropdown that matches the server variable type.Run the scenario or gate the write with a logic signal so writes happen only when desired.
π‘ Tips and Tricks
Use the
OPC UA Clientblock together with this block to manage connection lifecycle and reuse the same client for reads and writes.Pair with the
OPC UA Readblock to verify current values before writing or to implement read-verify-write flows.Use a
Logic Inputblock to trigger writes only when a condition is met (for example, write on a button press or when a measurement exceeds a threshold).Store or log values with
Data Write Global/Data Write Localor export withCSV Exportto keep an audit trail of writes.When writing numeric values, prefer selecting the matching integer/float
Data typeto avoid type conversion errors on the server.
π οΈ Troubleshooting
No client provided: make sure the
Clientinput is connected (use theOPC UA Clientblock).Connection errors: confirm the OPC UA client block shows a successful connection to the server before attempting writes.
Wrong address: verify the
Node Addressstring is the exact address expected by the server.Type mismatch: if the server rejects the value, try switching the
Data typeto the exact type of the target variable (e.g., Float vs Double, correct integer size).Control unwanted writes: gate the input with a
Logic Inputor other logic blocks so writes only occur when intended.
Last updated
Was this helpful?