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

  1. Add and configure an OPC UA Client block to establish and manage the server connection.

  2. Provide the client output into the Client input.

  3. Set the target node address into the Node Address input.

  4. Provide the data to write into the Value input.

  5. Select the appropriate Data type from the dropdown that matches the server variable type.

  6. Run the scenario or gate the write with a logic signal so writes happen only when desired.

πŸ’‘ Tips and Tricks

  • Use the OPC UA Client block together with this block to manage connection lifecycle and reuse the same client for reads and writes.

  • Pair with the OPC UA Read block to verify current values before writing or to implement read-verify-write flows.

  • Use a Logic Input block 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 Local or export with CSV Export to keep an audit trail of writes.

  • When writing numeric values, prefer selecting the matching integer/float Data type to avoid type conversion errors on the server.

πŸ› οΈ Troubleshooting

  • No client provided: make sure the Client input is connected (use the OPC UA Client block).

  • Connection errors: confirm the OPC UA client block shows a successful connection to the server before attempting writes.

  • Wrong address: verify the Node Address string is the exact address expected by the server.

  • Type mismatch: if the server rejects the value, try switching the Data type to the exact type of the target variable (e.g., Float vs Double, correct integer size).

  • Control unwanted writes: gate the input with a Logic Input or other logic blocks so writes only occur when intended.

Last updated

Was this helpful?