Map OPC UA Properties to tags
A Property is metadata attached to a node, not another ordinary Point collected as a process value. This example writes a temperature Point's limit and EngineeringUnits to target tags. The source must actually expose them as Properties; otherwise these two tags cannot be mapped.
Entry point: the OPC UA Server's address-space management tools; taosExplorer → Data Ingestion → OPC UA → Select Data Points; the taosExplorer Data Browser or taos CLI.
1. Prerequisites
- The source actually exposes attributes as Properties of a Variable, for example through
HasProperty. Creating an ordinary Variable with the same name is not equivalent. - The actual collection identity can browse Points and Properties, and the ordinary-Point secure connection check has passed.
- Use a separate test database or a new target supertable name so existing structures do not hide added tags. Do not delete production tables to refresh their structure.
- Do not give
custom_tagsthe same names as Properties. Property names and types must be compatible with target modeling.
2. Configuration example
Ask the Server administrator for an equivalent address space and actual NodeIds. Do not assume that ns=2;i=3 refers to the same location on every Server.
Objects
└── Plant
└── Area1
└── Temperature (Variable)
├── limit = "0~100" (Property)
└── EngineeringUnits = "degree Celsius" (Property)
- In the Point rules, narrow the root node to the parent containing Temperature. Select node type
allto retain Property browsing scope. - Initially match only this test Variable. Use supertable template
opc_limit_{type}and child-table templatet_{ns}_{id#/_}. - Choose the time source according to business needs, such as ordinary source time
original_tswith column namets. Mapping Properties to tags does not require switching to receive time for ingestion. - View the Point list and mappings. Confirm that the Properties have not been selected as two independent process values. Submit and start, then wait for the test Point to be written.
3. Query and interpretation
The example target database is opcua_demo, and the expected supertable for a Double Point is opc_limit_double. Use the actual expanded name. Run the following in the taosExplorer Data Browser or taos CLI:
DESCRIBE opcua_demo.opc_limit_double;
SELECT tbname, `limit`, `EngineeringUnits`
FROM opcua_demo.opc_limit_double
LIMIT 5;
DESCRIBE should show tag columns for both Properties. Query values must match the Server Properties. If the table exists but all tags are null, still investigate Property mapping and check that the queried child table corresponds to this example's Variable.
4. Common problems and maintenance
| Symptom | Check and action |
|---|---|
| Only custom tags appear | Check that nodes are actual Properties, the browse identity has permissions, and the rule scope and node type include Properties. |
| New tags cannot be found | First check the actual target table and existing structure. Use a new test table to isolate modeling problems; do not directly clear historical tables. |
| Duplicate tag names or type conflicts | Adjust custom tag names and check the existing supertable. Assess existing queries and backups before schema migration. |
| Source Property changed but target did not update | Tags are not real-time sampled columns. First confirm the task's model update mechanism. Maintain existing tags through tag SQL or the corresponding management tool. |
Tags store Point attributes, not a history of every range change. Design a separate model if a time series of Property changes is required. For the distinction between Point CSVs and rule-based custom tags, see OPC UA Point mapping CSV.