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:
VLM As Classifier,Line Counter,Google Gemma API,MoonshotAI Kimi,Stitch OCR Detections,Distance Measurement,Image Stack,Anthropic Claude,Detection Event Log,SIFT Comparison,S3 Sink,LMM For Classification,Perspective Correction,Microsoft SQL Server Sink,Roboflow Custom Metadata,Google Vision OCR,Twilio SMS Notification,Dynamic Zone,Qwen-VL,Camera Focus,JSON Parser,Email Notification,Roboflow Vision Events,PTZ Tracking (ONVIF),Stitch OCR Detections,Google Gemma,Event Writer,Qwen3.5-VL,Llama 3.2 Vision,Email Notification,Twilio SMS/MMS Notification,Identify Outliers,SIFT Comparison,OPC UA Writer Sink,Identify Changes,Llama 3.2 Vision,Template Matching,Model Monitoring Inference Aggregator,Camera Focus,OpenRouter,OpenAI,Gaze Detection,Florence-2 Model,OpenAI-Compatible LLM,MoonshotAI Kimi,OpenAI,Single-Label Classification Model,OCR Model,VLM As Detector,Motion Detection,CogVLM,Instance Segmentation Model,Anthropic Claude,Google Gemini,Qwen 3.6 API,Clip Comparison,Google Gemini,Detections Consensus,CSV Formatter,Webhook Sink,Multi-Label Classification Model,LMM,OpenAI,Florence-2 Model,PLC Reader,Current Time,OpenAI,VLM As Detector,Line Counter,Google Gemini,Roboflow Visual Search,Slack Notification,EasyOCR,Roboflow Dataset Upload,Roboflow Dataset Upload,PLC Writer,Qwen 3.5 API,Anthropic Claude,Object Detection Model,Local File Sink,Cosine Similarity,MQTT Writer,Keypoint Detection Model,VLM As Classifier,Image Contours,Pixel Color Count,GLM-OCR,Roboflow Asset Library Attributes - outputs:
Line Counter,MoonshotAI Kimi,Stability AI Image Generation,Trace Visualization,Path Deviation,Image Stack,Anthropic Claude,Icon Visualization,SIFT Comparison,Morphological Transformation,Color Visualization,LMM For Classification,Single-Label Classification Model,Perspective Correction,Corner Visualization,Roboflow Custom Metadata,Halo Visualization,Dynamic Zone,Keypoint Detection Model,Qwen-VL,Email Notification,Halo Visualization,Object Detection Model,Google Gemma,Background Color Visualization,Ellipse Visualization,Email Notification,Twilio SMS/MMS Notification,Text Display,Polygon Visualization,Crop Visualization,Image Preprocessing,Template Matching,Model Monitoring Inference Aggregator,OpenRouter,OpenAI,Florence-2 Model,Motion Detection,Heatmap Visualization,OpenAI,Perception Encoder Embedding Model,Blur Visualization,Depth Estimation,Instance Segmentation Model,Stability AI Outpainting,Anthropic Claude,YOLO-World Model,Google Gemini,Clip Comparison,Google Gemini,Keypoint Visualization,Webhook Sink,Florence-2 Model,Current Time,Contrast Equalization,OpenAI,Moondream2,Line Counter,Google Gemini,Slack Notification,Triangle Visualization,Time in Zone,CLIP Embedding Model,Multi-Label Classification Model,Local File Sink,Keypoint Detection Model,Pixel Color Count,GLM-OCR,Roboflow Asset Library Attributes,Polygon Zone Visualization,Time in Zone,Google Gemma API,Stitch OCR Detections,Line Counter Visualization,Semantic Segmentation Model,Distance Measurement,Image Threshold,Multi-Label Classification Model,Camera Calibration,QR Code Generator,S3 Sink,Microsoft SQL Server Sink,Twilio SMS Notification,Google Vision OCR,Image Blur,Morphological Transformation,Roboflow Vision Events,Size Measurement,PTZ Tracking (ONVIF),Stability AI Inpainting,Classification Label Visualization,Stitch OCR Detections,Event Writer,Qwen3.5-VL,Mask Visualization,Llama 3.2 Vision,Reference Path Visualization,Label Visualization,OPC UA Writer Sink,Dot Visualization,Cache Set,Dynamic Crop,Detections Stitch,Circle Visualization,Llama 3.2 Vision,BoT-SORT Tracker,Path Deviation,SAM3 Video Tracker,Gaze Detection,Segment Anything 2 Model,OpenAI-Compatible LLM,MoonshotAI Kimi,Single-Label Classification Model,CogVLM,Object Detection Model,SAM 3 Interactive,Qwen 3.6 API,Detections Consensus,Bounding Box Visualization,Multi-Label Classification Model,LMM,OpenAI,SAM 3,Instance Segmentation Model,Roboflow Visual Search,Roboflow Dataset Upload,SAM 3,Cache Get,Instance Segmentation Model,Detections Classes Replacement,Pixelate Visualization,Keypoint Detection Model,Instance Segmentation Model,Roboflow Dataset Upload,PLC Writer,Qwen 3.5 API,Object Detection Model,Anthropic Claude,Time in Zone,MQTT Writer,Polygon Visualization,SAM 3,Model Comparison Visualization,Single-Label Classification Model,Seg Preview
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[boolean,float,string,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
}