Skip to main content

OPC UA Overview

The OPCUA route enables communication with OPC UA servers, providing a standardized, cross-platform protocol for industrial automation. It supports multiple authentication modes, security policies, and both NodeId and BrowsePath addressing.
OPC UA is vendor-neutral and widely supported by modern industrial equipment. Use it when you need secure, standardized communication across different manufacturer’s devices.

Basic Syntax


Connection Configuration

OPCUA_CONFIG Parameters

string
required
OPC UA server endpoint URL (e.g., opc.tcp://localhost:4840).
integer
Authentication mode:
  • 0 - Anonymous (no authentication)
  • 1 - Username/Password
  • 2 - Certificate
Default: 0.
string
Username for authentication (required if AUTH_MODE is 1).
string
Password for authentication (required if AUTH_MODE is 1).
boolean
Enable security mode. Default: false.
integer
Security policy level:
  • 0 - None
  • 1 - Basic128Rsa15
  • 2 - Basic256
  • 3 - Basic256Sha256
  • 4 - Aes128_Sha256_RsaOaep
  • 5 - Aes256_Sha256_RsaPss
Default: 0.
integer
Message security mode:
  • 0 - None
  • 1 - Sign
  • 2 - SignAndEncrypt
Default: 0.
boolean
Automatically accept untrusted server certificates. Default: false.
boolean
Suppress nonce validation errors. Default: false.
integer
Connection timeout in milliseconds. Default: 90000.

Security Configuration

For development or trusted networks:

NodeId Addressing

OPC UA uses NodeIds to identify variables. The format is: ns=<namespace>;s=<identifier> or ns=<namespace>;i=<numeric_id>

Finding NodeIds

Use an OPC UA browser tool (like UaExpert, Prosys OPC UA Browser, or similar) to explore the server’s address space and find the correct NodeIds.

BrowsePath Mode

For servers that support it, you can use symbolic paths instead of NodeIds:
boolean
Enable BrowsePath mode - treat all TAG addresses as browse paths instead of NodeIds.
string
Root path for browsing when USE_BROWSE_PATH is enabled. Default: Objects.

BrowsePath Example


Data Types


TAG Configuration

Complete TAG Example

TAG Parameters

string
required
OPC UA NodeId (e.g., ns=2;s=MyVariable or ns=2;i=1234) or BrowsePath if USE_BROWSE_PATH is enabled.
string
required
OPC UA data type: BOOLEAN, BYTE, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, STRING.
boolean
Indicates if the value is an array. Default: false.
double
Multiplier for value transformation. Default: 1.0.
double
Offset added after scaling. Default: 0.0.
integer
Decimal places in output. Default: 2.
double
Minimum allowed value.
double
Maximum allowed value.
double
Minimum change to trigger publish. Default: 0.0.
string
Topic where PLC values are published. Subscribe here to receive sensor data.
string
Output format: VALUE_ONLY or JSON. Default: VALUE_ONLY.
string
Engineering unit for documentation.
string
Human-readable description.
boolean
Allow writing to this node. Default: false.
string
Topic to send write commands. Publish a value here to write it to the PLC.

Event-Based Operations

For on-demand OPC UA operations (not polling), use the EVENT syntax. Publish a message to SOURCE_TOPIC to trigger the operation; the route executes it and publishes the result to DESTINATION_TOPIC.

Supported Operations

Query Parameters

Read Example

Read a node value on demand:

Write Example

Write a FLOAT value to a node on demand:

Complete Examples

Simple OPC UA connection with anonymous access:

Security Best Practices

Always enable security for production deployments:
In production, properly configure certificate trust:
Instead, exchange certificates between client and server during commissioning.
Prefer username/password or certificate authentication over anonymous:

Troubleshooting

  • Verify endpoint URL is correct
  • Check firewall allows TCP port (usually 4840)
  • Ensure server is running and accessible
  • Try increasing TIMEOUT value
  • Verify security policy matches server configuration
  • Check certificate trust (may need to accept in server)
  • For testing, try WITH AUTO_ACCEPT_UNTRUSTED_CERTIFICATES "true"
  • Ensure client certificates are properly configured
  • Use OPC UA browser to verify correct NodeId
  • Check namespace index (ns=) is correct
  • Verify node exists in server’s address space
  • Try BrowsePath mode if NodeId is unclear
  • Verify username and password
  • Check user has appropriate permissions
  • Ensure AUTH_MODE matches server requirements
  • Verify DATA_TYPE matches server variable type
  • Check IS_ARRAY setting for array values
  • Verify SCALING and OFFSET calculations

Next Steps

Siemens S7

Direct connection to Siemens PLCs.

ADS (Beckhoff)

Connect to TwinCAT systems.
Last modified on July 3, 2026