Skip to main content

OPC UA Sender Connector

The OPC UA Sender Connector allows writing data to OPC UA server nodes, enabling control and configuration of industrial automation systems and IoT devices.

Service Description

The OPC UA Sender Connector enables writing values to OPC UA server nodes. It establishes a secure connection to the OPC UA server, authenticates, and writes data to specified nodes.

Required Connector Properties

  • Host: The OPC UA server endpoint URL (e.g., opc.tcp://localhost:4840)
  • Anonymous Login: Enable anonymous authentication (true/false)
  • Basic Authentication ID: Credential ID for username/password authentication
  • Allowed Security Policies: Security policy to use (None, Basic128Rsa15, Basic256, Basic256Sha256)
  • Key Alias: Certificate key alias for certificate-based authentication
  • Key Store ID: Key store containing the client certificate
  • Application URI: Unique identifier for the OPC UA client application
  • Application Name: Descriptive name for the OPC UA client
  • Node IDs: Comma-separated list of OPC UA node identifiers to write to
  • Data Type: Data type of the values to write (Boolean, Int32, Double, String, etc.)

Configuration Details

Connection Settings

  • Host: Full OPC UA endpoint URL including protocol (opc.tcp://)
  • Application URI: Should be unique and match certificate if using certificate auth
  • Application Name: Identifies your application in OPC UA server logs

Authentication

Choose one of the following authentication methods:

Anonymous Login

  • Set Anonymous Login to true
  • No credentials required (use only in trusted networks)

Username/Password Authentication

  • Set Anonymous Login to false
  • Configure Basic Authentication ID with credential reference
  • Credentials must be pre-configured in Operations → Credentials

Certificate-based Authentication

  • Set Anonymous Login to false
  • Configure Key Store ID with keystore reference
  • Configure Key Alias with certificate alias
  • Certificate must be pre-configured in Operations → Keystores

Security Policy

Select appropriate security policy:

  • None: No encryption (use only for testing)
  • Basic128Rsa15: RSA 1024-bit encryption (legacy)
  • Basic256: RSA 2048-bit encryption
  • Basic256Sha256: RSA 2048-bit with SHA-256 (recommended)

Node Configuration

  • Node IDs: Specify OPC UA node identifiers (e.g., ns=2;s=MyDevice.Temperature)
    • Format: ns=<namespace>;s=<identifier> or ns=<namespace>;i=<numeric>
    • Multiple nodes: ns=2;s=Node1,ns=2;s=Node2
  • Data Type: Must match the OPC UA node's data type

Supported Data Types

  • Boolean: true/false values
  • Byte, SByte: 8-bit integers
  • Int16, UInt16: 16-bit integers
  • Int32, UInt32: 32-bit integers
  • Int64, UInt64: 64-bit integers
  • Float: 32-bit floating point
  • Double: 64-bit floating point
  • String: Text values
  • DateTime: Timestamp values

Message Flow

  1. Message arrives at OPC UA Sender connector
  2. Connector establishes connection to OPC UA server
  3. Authenticates using configured method
  4. Extracts values from message body
  5. Writes values to specified OPC UA nodes
  6. Receives write confirmation from server
  7. Closes connection or maintains for next write

Best Practices

  1. Use Secure Policies: Always use encryption in production (Basic256Sha256)
  2. Certificate Authentication: Prefer certificate-based auth over username/password
  3. Validate Node IDs: Ensure node IDs exist and are writable on the server
  4. Match Data Types: Verify data types match OPC UA node definitions
  5. Handle Errors: Implement error handling for connection and write failures
  6. Connection Pooling: Reuse connections for better performance
  7. Monitor Write Status: Track write confirmations and failures
Usage

Use the OPC UA Sender Connector when you need to control industrial equipment, update setpoints, or configure IoT devices. Common scenarios include sending production commands to PLCs, updating temperature setpoints, or controlling actuators.

Message Format

The message body should contain the values to write:

{
"values": [
{
"nodeId": "ns=2;s=MyDevice.Temperature",
"value": 25.5
},
{
"nodeId": "ns=2;s=MyDevice.Status",
"value": "Running"
}
]
}

Or for single value:

{
"value": 25.5
}

Error Handling

Common errors and solutions:

  • Connection Failed: Verify host URL and network connectivity
  • Authentication Error: Check credentials or certificate configuration
  • Security Policy Mismatch: Ensure policy matches server requirements
  • Node Not Found: Verify node ID exists on the server
  • Access Denied: Check user permissions for writing to nodes
  • Data Type Mismatch: Ensure value type matches node data type
  • Certificate Error: Verify certificate validity and trust

Integration Example

A typical integration flow using OPC UA Sender:

  1. Timer/Trigger: Initiates the flow periodically
  2. Database/API: Retrieves control values
  3. Mapping: Transforms data to OPC UA format
  4. OPC UA Sender: Writes values to OPC UA server
  5. Logging: Records write operations for audit