Workflow 9: Configure OPC UA Server with Tags
You are at https://api.litmus.io/workflows/configure-opcua-server.md Parent: https://api.litmus.io/workflows/agents.md If this is the wrong workflow, back out to the index above.
9. Configure OPC UA Server with Tags
UI trigger: OPC UA -> Import Tags -> Start Server (optionally hand-build folders, devices and tag nodes)
Step table
| Step | API Name | Method | Endpoint / GraphQL Operation | Notes | Output |
|---|---|---|---|---|---|
| 1 | Get Node Root | POST |
{{edgeUrl}}/opcua/v2 -> GetNodeRoot |
See current OPC UA hierarchy | Existing node tree |
| 2a | Import All DeviceHub Tags | POST |
{{edgeUrl}}/opcua/v2 -> ImportDeviceHubTags |
Imports every DeviceHub tag into OPC UA | Nodes created |
| 2b | Import Some DeviceHub Tags | POST |
{{edgeUrl}}/opcua/v2 -> ImportSomeDeviceHubTags |
Selective import: ImportSomeDeviceTagsRequest with Tags: [{DeviceID, RegistersID}]; omit RegistersID to import every register of that device |
Nodes created |
| 3 | Start OPC UA Service | POST |
{{edgeUrl}}/opcua/v2 -> ServiceStart |
Starts the OPC UA server | Server running |
| 4 | Get Service Configuration | POST |
{{edgeUrl}}/opcua/v2 -> GetServiceConfig |
Verify endpoint URL, auth settings | Config object |
| 5 | Add Folder Node | POST |
{{edgeUrl}}/opcua/v2 -> CreateNode |
NodeType: FOLDER under a ParentID (the root NodeID from step 1 or an earlier node) |
New folder node ID |
| 6 | Add Device Node | POST |
{{edgeUrl}}/opcua/v2 -> CreateNode |
NodeType: DEVICE under the root or a folder from step 5 |
New device node ID |
| 7 | Add Tag Node | POST |
{{edgeUrl}}/opcua/v2 -> CreateNode |
Tag node under a device node from step 6; Data.TopicName binds it to a DeviceHub topic (not validated, so a misspelt topic never receives values). Optional originId |
New tag node ID |
| 8 | Delete Folder and Everything Below (cleanup) | POST |
{{edgeUrl}}/opcua/v2 -> DeleteNodeByRef |
NodeRef {ID, ParentID}; optional expectedVersion guards against deleting a node changed since you read it |
Node and its subtree removed |
Steps 2a/2b import DeviceHub tags wholesale. Steps 5-7 build the address space by hand instead; all three node kinds use the same
CreateNodemutation and differ only byNodeType. An unknownParentIDfails withparent node "<id>" not found.