Skip to main content

OPC UA

For ordinary OPC UA Point-value ingestion, first use a single Point to verify the connection, Point selection, modeling, and ingestion. Collection supports observe polling and subscribe subscriptions. Alarm and event notifications use separate tasks and are not ordinary numeric Point collection.

Entry point: taosExplorer → Data Ingestion → OPC UA. Run SQL commands in the taosExplorer Data Browser or taos CLI.

info

This page ingests ordinary Point values. For notifications such as alarms and state changes, use OPC UA alarms and events. Do not collect alarm lifecycles as ordinary numeric Points.

1. Prepare one controllable Point​

Confirm each item below before starting. The actual collection host is the taosX host or selected taosX-Agent host; the browser host does not necessarily perform reads.

ItemRequired materials or resultOwner
Components and licensingMatching taosX, taosX-Agent, and OPC plugin versions, with the required features licensedTDengine TSDB administrator.
Collection locationActual collection host can access the source endpoint; when using an agent, it can connect to taosXDeployment operations staff. For port directions, see Pre-installation and deployment checks.
Source endpointHost, port, path, and namespace; published address accessible from the collection hostOPC UA administrator.
Secure channelSecurity mode and policy; when needed, PEM client certificate, private key, and source trustSource and certificate administrators. See OPC UA client certificates.
User identityAnonymous, username/password, or user certificate allowed by the source; at least browse, read, and subscribe permissions for selected PointsSource administrator. Do not grant write/control permissions for ordinary collection.
Test PointOne Double Point approved for testing, with complete NodeId, current value, quality, and source timestampObtain permission before changing values; do not change production control Points.
Target permissionsSeparate test database and actual write identity, with table creation and write permissions for the selected modelAuthorized TDengine TSDB administrator.

Have an authorized TDengine TSDB administrator run CREATE DATABASE opcua_demo PRECISION 'ms'; in the taosExplorer Data Browser or taos CLI. Use another database name if an object of the same name already exists.

2. Minimal configuration​

  1. Add an OPC UA data source, select opcua_demo and the agent to use, and enter the actual endpoint. Enter the page address as 主机:端口/路径: the part after the protocol prefix in the full opc.tcp:// endpoint provided by the administrator.
  2. Match security settings to source requirements. For signing or encryption, prepare a client certificate and private key and have the Server trust the certificate. Then run a connectivity check.
  3. Choose rule-based Point selection and match only one test Point. For example, for NodeId ns=2;s=Demo/Temperature, select namespace 2 and expression ^ns=2;s=Demo/Temperature$. View the Point list and confirm actual matches and types.
  4. Use supertable template opc_{type}, child-table template t_{ns}_{id#/_}, value column val, timestamp source original_ts, and column name ts. Explicitly select observe and set a test interval of 5 seconds.
  5. Submit and start. Record the source value and timestamp, and wait for the collection interval and batch write.

The NodeId only illustrates the format; it is not a default Point on every Server. When using an actual Point, replace both the filter and subsequent table names.

2.1 Configure connection and authentication​

Under Data Ingestion, click Create New Task, select OPC-UA, and enter the task name, target database, and actual collection location. In Connection Configuration, enter the service address provided by the administrator. Enter failover addresses only if the source has deployed and supplied standby services. A different Server that does not share the same Points is not a standby.

OPC UA service address, secure channel, and connection timeout

Configure the secure channel and user authentication separately. Security Mode, Security Policy, the communication certificate, and private key protect the connection. Anonymous, username, or certificate access under Authentication identifies the user. Choose a source-allowed method. An anonymous option in the interface does not mean the source permits anonymous reads. Before uploading files, use OPC UA client certificates to check certificate/key pairing, intended certificate use, and source trust.

Three OPC UA user authentication methods

Click Check Connectivity. If it fails, resolve address, trust, or identity problems before selecting Points. Even after connection succeeds, verify read permissions for the selected Points.

2.2 Check security combinations and standby endpoints​

warning

Before submission, check both security mode and policy. If either remains None, do not treat the other setting's signing or encryption name as proof of active protection. Use a matching mode, policy, and certificate combination offered by the Server, and complete connectivity, test-Point read, and target-value checks. Do not downgrade production tasks to None for troubleshooting.

When using taosx run directly, enter the actual port in the DSN; do not omit it because the interface suggests a common port. Do not mix username/password and user certificates: when both exist, username/password takes precedence. Direct DSN user certificates and keys use @文件路径 readable by the actual collection process. Prepare channel and user certificates separately. For file representations and exact keys, see OPC UA connection parameters.

Before configuring standby endpoints, have the source administrator confirm equivalent namespaces, complete NodeIds, permissions, and security combinations for each. Another Server accepting TCP connections cannot necessarily continue collecting the original Points. Standby addresses in a direct DSN inherit the main task's query parameters, but do not automatically copy username/password from the main address or retain independent query parameters in standby addresses. Successful primary-endpoint authentication does not replace standby verification. First check each connection and test Point separately, then rehearse switchover under approved isolated conditions. Do not temporarily disconnect production networking to test it.

2.3 Select Points and collection mode​

On Select Data Points, narrow the scope by namespace and expression, then click View Point List. Check the match count, complete NodeIds, and types before entering target templates. Initially select only one Point; do not use an empty filter as a test scope.

OPC UA rule-based Point selection and target model fields

Expand Collection Configuration. For the first exercise, explicitly switch to observe and set Collection Interval to 5 seconds. New forms initially select subscribe. Collection interval and collection timeout appear only after switching to observe, both initially 10 seconds. Point Update Interval initially uses 600 seconds for rediscovering Points; it is not this example's read interval.

OPC UA polling mode showing collection interval and timeout

Set Report Abnormal Values as needed, and check both quality and null values during verification. If it remains initially disabled, do not mistake the absence of abnormal-quality records for a network interruption. Before submission, recheck the current tab, Point scope, target templates, and collection mode. After submission, return to the task list, start the task if not running, and verify it using this page.

3. Modes and models​

observe reads current values at intervals; subscribe receives source change notifications. Source, request, and receive timestamps have different meanings. Choose according to business needs rather than changing the primary-key source merely to increase row counts.

The collection interval is a task-level setting. Split Points with different polling intervals into separate tasks. Subscription mode is driven by Server notifications; polling intervals cannot determine notification frequency. Read timeout differs from batch delay: the former limits waiting for a source response, while the latter limits how long collected data waits for batching.

3.1 Point-list or polling request timeouts​

First record whether the failure occurs during connectivity checking, Point-list browsing, or production polling. Retain original errors such as StatusBadTimeout and the node scope. The source may be unable to handle oversized request batches. Narrow the test Point scope first, change only one parameter at a time, and compare results. Do not merely extend request timeouts.

Direct DSN max_nodes_per_read and max_nodes_per_browse limit nodes per source Read/Browse request, not target write batches, total Point counts, or subscription notification intervals. General servers use a safe cap of 1000 when unset or 0, retaining any smaller source-reported limit. For recognized Kepware servers, the plugin uses 10000 as the baseline and caps it downward with an explicit positive value. This branch does not guarantee retention of smaller source-reported limits; configure and verify against the actual Server's capacity.

To reduce source request pressure, first use an approved small Point set and a smaller positive cap, such as 100, in a separate test task. Confirm a complete Point list and reasonable source load, then check production polling and target values. Successful Browse does not mean Read, subscriptions, or writes have passed. For parameters and timeout units, see OPC UA connection parameters. Do not enter an integer-second request timeout as 10s, or substitute the two node caps for the UI batch size.

The Point set has four tabs. Only the current tab's configuration is submitted:

TabSupported operations
Select Data PointsSelect ordinary Points by root node, namespace, and expression, and configure target templates.
Upload CSV Configuration FileUpload a reviewed fixed Point list and define target mappings per Point.
Select Points from TreeBrowse and select ordinary Points, configure target mappings, and apply them to the task.
Alarms and EventsSubscribe to events using event mode; the model differs from ordinary Point values.

Create separate tasks for ordinary Points and events. A numeric CSV cannot serve as an event model. Switching tabs retains their individual drafts but does not merge them for submission.

For tree selection, first complete the connectivity check, then click Browse Points. Clicking an object name expands child nodes; selecting a parent selects its underlying Points. Expand to the test object first and confirm the selected scope, then configure supertable, child table, columns, and tags. After applying, check the mapping list to avoid selecting an entire device or plant accidentally.

OPC UA tree-selection entry point before mappings have been applied

For batch Point downloads, full column definitions, time primary keys, tags, NodeId references, and comma escaping, see OPC UA Point mapping CSV. Before expanding scope, check expanded table names, types, and case against expectations, especially target conflicts caused by character replacement.

3.2 New Point discovery and existing update modes​

Rule-based ordinary-Point tasks can enable Automatically Synchronize New Points to browse the saved scope periodically and add new matching Points. This is disabled by default and does not apply to fixed CSV or event mode. It cannot be combined with the existing Append or Update modes. The Point update interval controls browsing, not observe sampling. Its configured period is not a guarantee of new-Point ingestion latency.

MethodPurposeConfirm before maintenance
Automatically Synchronize New PointsIngest new nodes matching the rulesNew node types and targets must be compatible. Disappeared nodes are not automatically cleaned up as historical deletions, and source type changes do not automatically change target structures.
NoneNo existing dynamic updatesMaintain the Point list or configuration separately for later additions.
AppendExisting append-only update methodDo not enable together with automatic synchronization of new Points.
UpdateExisting addition and deletion synchronizationCheck impact on target tables and historical data first. This is not a risk-free Point refresh.

When editing or copying existing tasks, check saved values rather than assuming they match a new task. To add a few Points manually to an existing CSV task, follow Manually add a few Points: back up the Point list in use, check update mode, complete the dialog, and verify new and existing Points. None performs no periodic Point-list updates; successful appending does not mean immediate runtime effect. Changing a Point list does not require reinstalling taosX-Agent.

3.3 Production topics​

TaskMain page
Issue, verify, and upload client certificatesOPC UA client certificates
Batch Point lists, templates, and CSV escapingOPC UA Point mapping CSV
Ignition endpoints, identities, and certificate trustConnect to Ignition OPC UA Server
GE certificate trust and user associationConnect to GE CSS OPC UA Server
Write node Properties as tagsMap OPC UA Properties to tags
Event types, lifecycles, and notification ingestionOPC UA alarms and events

Measure before adjusting batches, write concurrency, logs, and raw retention using Tuning and resource control. Do not apply other sources' defaults based on the connector name. Store-and-forward protects data already received and successfully cached. The cache path belongs to the actual collection host, not the browser host. For operations and boundaries, see Restart, checkpoints, and store-and-forward.

OPC UA advanced options and cache switch

0 for Maximum Write Concurrency means automatic configuration, not disabled writes. This form initially uses Batch Size 1000 and Batch Delay 1 second. Retain initial values for single-Point verification, then tune against read, queue, and write times. Interpret health thresholds using Health checks and no-data diagnosis. A single threshold does not establish that failover occurs or an alarm is guaranteed.

For direct DSN collection, Point filtering, reporting, and retention options, see OPC collection and runtime parameters. These differ from source Read/Browse node caps, and simultaneous aliases do not necessarily use last-write-wins precedence. To troubleshoot retention, use View OPC ordinary Point-value retention to find actual files, interpret fields, and check quality. Retention files are neither caches nor proof of target writes.

4. Verification​

Run the example query in the taosExplorer Data Browser or taos CLI. Use the actual table name if the Point name differs:

SELECT ts, CAST(ts AS BIGINT) AS ts_ms, val
FROM opcua_demo.`t_2_Demo_Temperature`
ORDER BY ts DESC LIMIT 10;

Compare source records at the same time and check target values and source timestamps. A millisecond database need not retain sub-millisecond precision. Ask the administrator to change the test value to an identifiable value such as 26.5, confirm that the source timestamp updates, then query again. Repeated polling with the same source timestamp does not guarantee additional target rows.

5. Troubleshooting​

SymptomCheck
Plugin not foundCheck the actual collection host, not the browser host.
Secure connection failsCheck policy, mode, certificate trust, and user identity separately; do not disable production security policies.
No Points in the listCheck namespace, NodeId, expression, and browse permissions.
No table or no updatesCheck actual expanded table names and case, and changes in Point values/source timestamps.

For other task, write, and runtime problems, see Troubleshooting by symptom.

6. Stopping, recovery, and limitations​

In v3.4.4.2, observe no longer continues reporting stale cached values for affected Points during disconnections or read failures. The collection plugin exits when UA/DA reporting to taosX fails. Whether it is restarted depends on the actual external supervisor and task retry conditions. Standalone execution without an external supervisor must not be assumed to restart automatically after exit. After recovery, still check task status and new target values.

Stop the original task, then verify latest values after restarting. Ordinary current-value collection does not guarantee recovery of every change during downtime, and restarting the plugin does not backfill source changes that were never collected. Caches protect only data already received; see Restart, checkpoints, and store-and-forward. Verify secure connections, batch models, and production Servers separately. For the complete single-Point exercise, see Collect the first Point from OPC UA.