OPC UA Client
OPC UA via the Site Runtime opcua (None/Sign/Sign&Encrypt Read/Write/Subscribe/Browse; conditions LAB).
| Property | Value |
|---|---|
| Console protocol id | opc-ua-client |
| Site Runtime plugin | opcua |
| Transport | Ethernet (TCP/UDP) |
| Read | yes |
| Write | yes — through approved writes |
| Subscribe | — |
| Device families | OPC UA Server |
| Default group interval | 100 ms |
| Maturity | Production: complete driver (connection handling, address forms, batching, read and write) |
Create the device
- Open Connectivity → Devices and click Add device.
- Pick OPC UA Client in the protocol list.
- Choose the Site Runtime that can reach the device, fill the connection parameters below and click Create & connect.
- Add a group (poll interval) and tags with the address formats below. See Devices and Groups and tags for the full walk-through.
Connection parameters
Every field the Console shows for this protocol. Required fields must be set before the device can be saved.
| Parameter | Type | Default | Range / options | Required | Description |
|---|---|---|---|---|---|
Endpoint URLurl | string | opc.tcp://127.0.0.1:4840/ | max 256 chars | yes | OPCUA server endpoint url |
Usernameusername | string | — | max 30 chars | no | |
Passwordpassword | string | — | max 30 chars | no | |
Certificate filecert | file | — | max 81960 chars | no | |
Key filekey | file | — | max 81960 chars | no | |
Security Modesecurity_mode | map | None | None, Sign, Sign & Encrypt | no | |
Update Modeupdate_mode | map | Read | Read, Subscribe, Read & Subscribe | no | |
Publish Interval (ms)publish-interval | int | 500 | 100 – 65535 | no | |
Event Root Nodeevent-root-node | string | 0!2253 | max 256 chars | no | OPC UA event root node for condition subscription (default: 0!2253 for Server node) |
Tag addresses and data types
Supported data types: INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, FLOAT, DOUBLE, BIT, BOOL, STRING, DATE_AND_TIME, ARRAY_CHAR, ARRAY_INT8, ARRAY_UINT8, ARRAY_INT16, ARRAY_UINT16, ARRAY_INT32, ARRAY_UINT32, ARRAY_INT64, ARRAY_UINT64, ARRAY_FLOAT, ARRAY_DOUBLE, ARRAY_BOOL, ARRAY_STRING, CUSTOM. The Console validates each tag address against the pattern for its data type before it is saved:
| Data types | Address pattern (regular expression) |
|---|---|
INT8 UINT8 INT16 UINT16 INT32 UINT32 INT64 UINT64 FLOAT DOUBLE BIT BOOL STRING | ^[0-9]+(\[\d{1,3}(,\d{1,3}){0,2}\])?!* |
DATE_AND_TIME ARRAY_CHAR ARRAY_INT8 ARRAY_UINT8 ARRAY_INT16 ARRAY_UINT16 ARRAY_INT32 ARRAY_UINT32 ARRAY_INT64 ARRAY_UINT64 ARRAY_FLOAT ARRAY_DOUBLE ARRAY_BOOL ARRAY_STRING | ^[0-9]+!* |
CUSTOM | ^cond:|alarm:|event:|method:[0-9]+!* |
Addressing and notes
Address syntax and examples
namespace!identifier
The OPC UA node id ns=2;s=Filler.Temperature is written 2!Filler.Temperature.
| Address | Meaning |
|---|---|
2!Filler.Temperature | String identifier in namespace 2 (the demo plant) |
2!s=Filler.Temperature | The same, with the explicit s= |
0!2253 | Numeric identifier 2253 in namespace 0 (the Server object) |
3!i=1001 | Numeric identifier with the explicit i= |
2!g=09087e75-8e5e-499b-954f-f2a9603db28a | GUID identifier |
2[0]!Pump.Values | Element 0 of an array (up to three indexes: 2[1,2]!Matrix) |
method:2!Pump.Reset | Call a method |
alarm: | Listen to alarms. A bare prefix means any. Also cond: and event:. |
Rules:
- The namespace index is the position in the server's namespace array. It can change between servers, and after a server restart on some servers. Read it from the server, for example with UaExpert. The demo plant uses
2. - Numeric ids and string ids are told apart by the form: digits only means numeric, anything else is a string.
- All numeric types, BOOL and STRING are available. Choose the type that matches the node's data type. The demo plant serves every value as DOUBLE.
- The Console has no node browser. Copy the node id from your server's tool.
Endianness
Not applicable. OPC UA delivers typed values and the byte order is part of the protocol.
Typical settings
| Setting | Typical | Note |
|---|---|---|
| Endpoint URL | opc.tcp://demo-sim:4840/demo-plant/ | Host name, port and path of the server. |
| Security Mode | None (1), Sign (2), Sign & Encrypt (3) | Default None. Use Sign & Encrypt in production. |
| Username, Password | empty | For servers with user authentication. |
| Certificate file, Key file | empty | The client certificate and key for Sign and Sign & Encrypt. |
| Update Mode | Read (default), Subscribe, Read & Subscribe | Subscribe uses monitored items and is the lightest on the server. |
| Publish Interval (ms) | 500 | 100 to 65535. The sampling and publish rate of subscriptions. |
| Event Root Node | 0!2253 | Where event and alarm listeners start. |
Poll group interval: 100 ms is the schema default. With Read the group interval is the read period. With Subscribe the server pushes changes, and the Subscribe attribute on a tag makes it report on change.
The quality of a value follows the OPC UA status code: good is good, uncertain is uncertain, anything else is bad.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
| Test succeeds, status stays Connecting | The test is only a TCP connect. The session fails (security, user). | Check Security Mode, user and certificates. |
| Session refused, certificate rejected | The server does not trust the client certificate. | Trust the client certificate in the server's certificate store. |
Tag bad, "node not found" | Wrong namespace index or identifier. | Read the node id from the server. |
| Namespace index changed after a restart | The server re-numbers its namespaces. | Fix the index, or use a server that keeps them stable. |
| Type mismatch | The tag type does not match the node. | Use the node's data type, or DOUBLE. |
| Values do not update | Update Mode Subscribe with a server that does not send changes. | Use Read or Read & Subscribe. |
| Write refused | The node is not writable, or the user has no right. | Check the node's access level. |