OPC UA Writer Sink¶
Class: OPCWriterSinkBlockV1
Source: inference.enterprise.workflows.enterprise_blocks.sinks.opc_writer.v1.OPCWriterSinkBlockV1
The OPC UA Writer block enables you to write data to a variable on an OPC UA server, leveraging the asyncua library for seamless communication.
Supported Data Types¶
This block supports writing the following data types to OPC UA server variables: - Numbers (integers, floats) - Booleans - Strings
Note: The data type you send must match the expected type of the target OPC UA variable.
Node Lookup Mode¶
The block supports two methods for locating OPC UA nodes via the node_lookup_mode parameter:
hierarchical(default): Uses standard OPC UA hierarchical path navigation. The block navigates through the address space usingget_child(). Each component in theobject_namepath is automatically prefixed with the namespace index.- Example:
object_name="Roboflow/Crane_11"→ path0:Objects/2:Roboflow/2:Crane_11/2:Variable -
Best for: Traditional OPC UA servers with hierarchical address spaces
-
direct: Uses direct NodeId string access. The block constructs a NodeId asns={namespace};s={object_name}/{variable_name}and accesses it directly viaget_node(). - Example:
object_name="[Sample_Tags]/Ramp"→ NodeIdns=2;s=[Sample_Tags]/Ramp/South_Person_Count - Best for: Ignition SCADA systems and other servers using string-based NodeId identifiers
Cooldown¶
To prevent excessive traffic to the OPC UA server, the block includes a cooldown_seconds parameter,
which defaults to 5 seconds. During the cooldown period:
- Consecutive executions of the block will set the throttling_status output to True.
- No data will be sent to the server.
You can customize the cooldown_seconds parameter based on your needs. Setting it to 0 disables
the cooldown entirely.
Asynchronous Execution¶
The block provides a fire_and_forget property for asynchronous execution:
- When fire_and_forget=True: The block sends data in the background, allowing the Workflow to
proceed immediately. However, the error_status output will always be set to False, so we do not
recommend this mode for debugging.
- When fire_and_forget=False: The block waits for confirmation before proceeding, ensuring errors
are captured in the error_status output.
Disabling the Block Dynamically¶
You can disable the OPC UA Writer block during execution by linking the disable_sink parameter
to a Workflow input. By providing a specific input value, you can dynamically prevent the block from
executing.
Connection Pooling¶
The block uses a connection pool to efficiently manage OPC UA connections. Instead of creating a new connection for each write operation, connections are reused across multiple writes to the same server. This significantly reduces latency and resource usage for high-frequency write scenarios.
- Connections are automatically pooled per server URL and username combination
- If a connection fails during a write operation, it is automatically invalidated and a new connection is established on the next write attempt
Retry Logic¶
The block includes configurable retry logic with exponential backoff for handling transient connection failures:
max_retries: Number of connection attempts before giving up (default: 3)retry_backoff_seconds: Base delay between retries in seconds (default: 1.0). The delay doubles after each failed attempt (exponential backoff).
Note: Authentication errors (wrong username/password) are not retried as they will continue to fail.
Cooldown Limitations¶
Cooldown Limitations
The cooldown feature is optimized for workflows involving video processing.
- In other contexts, such as Workflows triggered by HTTP services (e.g., Roboflow Hosted API,
Dedicated Deployment, or self-hosted Inference server), the cooldown timer will not be applied effectively.
Type identifier¶
Use the following identifier in step "type" field: roboflow_enterprise/opc_writer_sink@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
url |
str |
URL of the OPC UA server to which data will be written.. | ✅ |
namespace |
str |
The OPC UA namespace URI or index used to locate objects and variables.. | ✅ |
user_name |
str |
Optional username for authentication when connecting to the OPC UA server.. | ✅ |
password |
str |
Optional password for authentication when connecting to the OPC UA server.. | ✅ |
object_name |
str |
The name of the target object in the namespace to search for.. | ✅ |
variable_name |
str |
The name of the variable within the target object to be updated.. | ✅ |
value |
Union[bool, float, int, str] |
The value to be written to the target variable on the OPC UA server.. | ✅ |
value_type |
str |
The type of the value to be written to the target variable on the OPC UA server. Supported types: Boolean, Double, Float, Int16, Int32, Int64, Integer (Int64 alias), SByte, String, UInt16, UInt32, UInt64.. | ✅ |
timeout |
int |
The number of seconds to wait for a response from the OPC UA server before timing out.. | ✅ |
fire_and_forget |
bool |
Boolean flag to run the block asynchronously (True) for faster workflows or synchronously (False) for debugging and error handling.. | ✅ |
disable_sink |
bool |
Boolean flag to disable block execution.. | ✅ |
cooldown_seconds |
int |
The minimum number of seconds to wait between consecutive updates to the OPC UA server.. | ✅ |
node_lookup_mode |
str |
Method to locate the OPC UA node: 'hierarchical' uses path navigation, 'direct' uses NodeId strings (for Ignition-style string-based tags).. | ✅ |
max_retries |
int |
Maximum number of connection attempts before giving up. Default is 3 with exponential backoff starting at 15ms.. | ✅ |
retry_backoff_seconds |
float |
Base delay between retry attempts in seconds (doubles each retry). Default is 0.015 (15ms) for fast exponential backoff.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to OPC UA Writer Sink in version v1.
- inputs:
Twilio SMS/MMS Notification,OPC UA Writer Sink,Qwen 3.6 API,SIFT Comparison,Llama 3.2 Vision,PLC Writer,JSON Parser,Distance Measurement,Roboflow Visual Search Classifier,CogVLM,MQTT Writer,Google Gemini,OCR Model,GLM-OCR,Twilio SMS Notification,Instance Segmentation Model,Google Gemma API,PTZ Tracking (ONVIF),VLM As Detector,Florence-2 Model,LMM,OpenAI,Florence-2 Model,Line Counter,LMM For Classification,Event Writer,OpenAI,Keypoint Detection Model,Google Gemma,Slack Notification,Email Notification,Perspective Correction,Camera Focus,Detections Consensus,Line Counter,Multi-Label Classification Model,OpenAI-Compatible LLM,Object Detection Model,VLM As Classifier,Google Gemini,Roboflow Vision Events,Local File Sink,Stitch OCR Detections,PP-OCR,EasyOCR,Anthropic Claude,CSV Formatter,Dynamic Zone,Motion Detection,Stitch OCR Detections,Single-Label Classification Model,Qwen 3.5 API,Current Time,PLC Reader,Camera Focus,Google Gemini,Image Stack,Qwen-VL,MoonshotAI Kimi,Microsoft SQL Server Sink,Gaze Detection,Google Vision OCR,Webhook Sink,OpenAI,VLM As Detector,Identify Outliers,Cosine Similarity,S3 Sink,MoonshotAI Kimi,Anthropic Claude,Roboflow Dataset Upload,Detection Event Log,Template Matching,VLM As Classifier,Image Contours,Anthropic Claude,Roboflow Custom Metadata,Roboflow Asset Library Attributes,Model Monitoring Inference Aggregator,Clip Comparison,Roboflow Visual Search,OpenRouter,Llama 3.2 Vision,Qwen3.5-VL,Identify Changes,Email Notification,OpenAI,Roboflow Dataset Upload,Pixel Color Count,SIFT Comparison - outputs:
Keypoint Visualization,Twilio SMS/MMS Notification,Keypoint Detection Model,OPC UA Writer Sink,Perception Encoder Embedding Model,Qwen 3.6 API,Object Detection Model,SAM 3,PLC Writer,Llama 3.2 Vision,Distance Measurement,Roboflow Visual Search Classifier,Image Threshold,Polygon Zone Visualization,CogVLM,BoT-SORT Tracker,MQTT Writer,Contrast Equalization,Google Gemini,GLM-OCR,Reference Path Visualization,Twilio SMS Notification,Instance Segmentation Model,Google Gemma API,PTZ Tracking (ONVIF),Detections Classes Replacement,Florence-2 Model,Halo Visualization,SAM 3 Interactive,Dynamic Crop,Image Blur,LMM,Seg Preview,SAM 3,Ellipse Visualization,OpenAI,Florence-2 Model,Line Counter,LMM For Classification,Time in Zone,Cache Set,Instance Segmentation Model,Event Writer,Semantic Segmentation Model,OpenAI,Path Deviation,Time in Zone,Single-Label Classification Model,Keypoint Detection Model,Google Gemma,Slack Notification,Heatmap Visualization,Email Notification,Circle Visualization,Perspective Correction,Detections Consensus,Crop Visualization,Polygon Visualization,Keypoint Detection Model,Line Counter,Multi-Label Classification Model,Stability AI Inpainting,OpenAI-Compatible LLM,SAM 3,Object Detection Model,Google Gemini,Roboflow Vision Events,Multi-Label Classification Model,Size Measurement,Local File Sink,Object Detection Model,SAM3 Video Tracker,Dot Visualization,Line Counter Visualization,Time in Zone,Instance Segmentation Model,Depth Estimation,Stitch OCR Detections,Blur Visualization,Anthropic Claude,Segment Anything 2 Model,Color Visualization,Dynamic Zone,Motion Detection,Stitch OCR Detections,Single-Label Classification Model,Qwen 3.5 API,Trace Visualization,Icon Visualization,Current Time,Cache Get,Model Comparison Visualization,QR Code Generator,Google Gemini,Detections Stitch,Image Stack,Instance Segmentation Model,Qwen-VL,Mask Visualization,MoonshotAI Kimi,Microsoft SQL Server Sink,Text Display,Gaze Detection,Stability AI Image Generation,Google Vision OCR,Webhook Sink,OpenAI,Pixelate Visualization,S3 Sink,Classification Label Visualization,MoonshotAI Kimi,Polygon Visualization,Anthropic Claude,Roboflow Dataset Upload,Morphological Transformation,Bounding Box Visualization,Template Matching,Stability AI Outpainting,Anthropic Claude,Roboflow Custom Metadata,Multi-Label Classification Model,Roboflow Asset Library Attributes,Camera Calibration,Morphological Transformation,Path Deviation,Background Color Visualization,Model Monitoring Inference Aggregator,Clip Comparison,Corner Visualization,Moondream2,Roboflow Visual Search,OpenRouter,Qwen3.5-VL,Llama 3.2 Vision,Email Notification,Single-Label Classification Model,CLIP Embedding Model,Triangle Visualization,OpenAI,Roboflow Dataset Upload,Pixel Color Count,Image Preprocessing,SIFT Comparison,YOLO-World Model,Halo Visualization,Label Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
OPC UA Writer Sink in version v1 has.
Bindings
-
input
url(string): URL of the OPC UA server to which data will be written..namespace(string): The OPC UA namespace URI or index used to locate objects and variables..user_name(string): Optional username for authentication when connecting to the OPC UA server..password(string): Optional password for authentication when connecting to the OPC UA server..object_name(string): The name of the target object in the namespace to search for..variable_name(string): The name of the variable within the target object to be updated..value(Union[float,string,boolean,integer]): The value to be written to the target variable on the OPC UA server..value_type(string): The type of the value to be written to the target variable on the OPC UA server. Supported types: Boolean, Double, Float, Int16, Int32, Int64, Integer (Int64 alias), SByte, String, UInt16, UInt32, UInt64..timeout(integer): The number of seconds to wait for a response from the OPC UA server before timing out..fire_and_forget(boolean): Boolean flag to run the block asynchronously (True) for faster workflows or synchronously (False) for debugging and error handling..disable_sink(boolean): Boolean flag to disable block execution..cooldown_seconds(integer): The minimum number of seconds to wait between consecutive updates to the OPC UA server..node_lookup_mode(string): Method to locate the OPC UA node: 'hierarchical' uses path navigation, 'direct' uses NodeId strings (for Ignition-style string-based tags)..max_retries(integer): Maximum number of connection attempts before giving up. Default is 3 with exponential backoff starting at 15ms..retry_backoff_seconds(float): Base delay between retry attempts in seconds (doubles each retry). Default is 0.015 (15ms) for fast exponential backoff..
-
output
Example JSON definition of step OPC UA Writer Sink in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_enterprise/opc_writer_sink@v1",
"url": "opc.tcp://localhost:4840/freeopcua/server/",
"namespace": "http://examples.freeopcua.github.io",
"user_name": "John",
"password": "secret",
"object_name": "Line1",
"variable_name": "InspectionSuccess",
"value": "running",
"value_type": "Boolean",
"timeout": 10,
"fire_and_forget": true,
"disable_sink": false,
"cooldown_seconds": 10,
"node_lookup_mode": "hierarchical",
"max_retries": 1,
"retry_backoff_seconds": 0.015
}