Tutorial: Connect a Device
Connect an OPC-UA server, model a piece of equipment as tags, and verify live values.
You will need: a running QUBIQ with a super-admin or editor login, and an OPC-UA server you can reach. Time: ~20 minutes.
Step 1 — Discover the endpoint
Rather than guessing the security combination the server supports, ask it.
Connections → New connection → OPC-UA → Discover, and enter the base URL
(opc.tcp://192.168.1.10:4840).
The response lists every endpoint the server advertises, with its security mode, policy and certificate. Pick one — the form fills itself in.
Servers usually advertise a different endpoint URL per security level. This is why "works with
None, fails with SignAndEncrypt" is so common, and why discovery is the reliable route.
Step 2 — Create the connection
| Field | Value |
|---|---|
| Name | PLC1 |
| Endpoint | From discovery |
| Security mode | None for now |
| Security policy | None for now |
| Username / Password | If the server requires them |
Save. QUBIQ opens the connection, and its state shows in the Connections list — connected means it reached the endpoint and authenticated. There is no separate test step: the list shows the same signal that will tell you about this connection later.
We will tighten security in step 6 — prove reachability first, so a later failure has one obvious cause.
Step 3 — Browse the address space
You will pick addresses from the server rather than type them. The browse button beside the
address on a tag's Binding tab walks the server's address space and shows the node tree with
data types. Browse results carry the data type, which means QUBIQ can pre-fill your tags correctly
instead of you guessing between int32 and float.
For more than a handful of nodes, import them from the browse tree in one go instead. → Bulk import
Step 4 — Build the namespace
Namespace → New → Folder. Build the structure as the plant is laid out, not as the network is:
Site1/
Line1/
Filler/
Motor1/
Then create tags inside Motor1:
| Name | Data type | Unit | Description |
|---|---|---|---|
Speed | float | RPM | Motor 1 shaft speed |
Current | float | A | Motor 1 stator current |
Running | boolean | Motor 1 running feedback | |
Fault | boolean | Motor 1 fault |
Write the descriptions. They appear in pickers, tooltips and the AI assistant's context, and they are the difference between a model someone else can use and one only you understand.
Step 5 — Bind the tags
For each tag, open it and go to the Binding tab. Switch on Enable Binding, then:
| Field | Value |
|---|---|
| Protocol | OPC UA |
| Connection | PLC1 |
| Address | Pick the node with the browse button beside the field |
Save. OPC UA tags are subscribed — the server sends a value when it changes — with a 1000 ms publishing interval, so there is no rate to set. A tag has exactly one binding. → Protocol bindings
Within a second or two the namespace shows live values with Good quality.
If quality is not Good
| Quality | Meaning | Check |
|---|---|---|
NotFound | The address does not exist | Typo, or the PLC program changed. Browse to confirm. |
Unknown | No value yet | Wait a moment. If it stays, check the binding is enabled. |
Bad, waiting for initial data | Subscribed, first value not here yet | If it stays, the server is not serving that node. |
Bad | Read failed | Data-type mismatch, or insufficient rights on the node |
Uncertain | Suspect | The server is reporting a degraded source |
Step 6 — Turn on security
Now that data flows, secure the link.
- Discover again and pick a
SignAndEncrypt/Basic256Sha256endpoint. - Trust the server certificate — discovery returns it; trusting records its thumbprint, and a substituted certificate will then fail rather than silently connect.
- Get QUBIQ trusted by the server. Most servers reject an unknown client on the first attempt and place its certificate in a rejected list. Move it to the trusted store on the server and retry. This is normal and happens once.
- Test, and confirm tags return to
Good.
Step 7 — Tune
Now make it efficient.
Engineering ranges. On each analogue tag's Scaling tab, set the Engineering range —
0–3000 RPM for Speed, 0–50 A for Current. If the server sends raw counts rather than
engineering units, switch on Enable Scaling and give the raw range too: once, here, instead of
in every widget.
Deadbands. On the History tab, set 0.5–1 % of span on the analogue tags — as units, or as % of range, which reads the engineering range. This keeps sensor noise out of the historian and off any broker you publish to.
Speed eng 0–3000 RPM → deadband 5 RPM (or 0.2 % of range)
Current eng 0–50 A → deadband 0.1 A (or 0.2 % of range)
Leave stale-after off here. An OPC UA subscription sends nothing while a value holds steady, so a
motor that is simply not running would be marked stale. Stale after on the Binding tab is for
sources that report on a cycle. A dead OPC UA server already turns its tags Bad through the
connection. → Stale after
Step 8 — Verify
- All four tags show
Goodquality - Values change as the equipment runs
- The connection is healthy in the Connections list
- Security is
SignAndEncryptand still working - Engineering ranges and deadbands are set deliberately
- Descriptions and units are filled in
What comes next
| Next | Why |
|---|---|
| Build a dashboard | Put these tags on a screen |
| Alarm on a tag | React when Fault goes true |
| User-defined types | Do the next nineteen motors in minutes |
| Log data to SQL | Get this data into a report |
You have just defined the shape of "a motor". Turn it into a UDT now and the rest of the plant is parameters, not clicks. → User-defined types