Skip to main content
Version: 1.0.6

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.

Different security, different URL

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​

FieldValue
NamePLC1
EndpointFrom discovery
Security modeNone for now
Security policyNone for now
Username / PasswordIf 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 on the form.

We will tighten security in step 6 — prove reachability first, so a later failure has one obvious cause.


Step 3 — Browse the address space​

Open the connection and choose Browse. QUBIQ walks the server's address space and shows the node tree with data types.

Find the equipment you want to model and note its NodeIds. Browse results carry the data type, which means QUBIQ can pre-fill your tags correctly instead of you guessing between int32 and float.


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:

NameData typeUnitDescription
SpeedfloatRPMMotor 1 shaft speed
CurrentfloatAMotor 1 stator current
RunningbooleanMotor 1 running feedback
FaultbooleanMotor 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:

FieldValue
ProtocolOPC UA
ConnectionPLC1
AddressThe NodeId from browse — or pick it from the tree

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. → Protocol bindings

Within a second or two the namespace shows live values with Good quality.

If quality is not Good​

QualityMeaningCheck
NotFoundThe address does not existTypo, or the PLC program changed. Browse to confirm.
BadRead failedData-type mismatch, or insufficient rights on the node
UncertainSuspectThe server is reporting a degraded source

Step 6 — Turn on security​

Now that data flows, secure the link.

  1. Discover again and pick a SignAndEncrypt / Basic256Sha256 endpoint.
  2. Trust the server certificate — discovery returns it; trusting records its thumbprint, and a substituted certificate will then fail rather than silently connect.
  3. 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.
  4. Save, confirm the connection shows connected, and confirm tags return to Good.

Step 7 — Tune​

Now make it efficient.

Deadbands. On the History tab, set 0.5–1% of span on the analogue tags. This keeps sensor noise out of the historian and off any broker you publish to.

Speed eng 0–3000 RPM → deadband 5 RPM
Current eng 0–50 A → deadband 0.1 A

Scaling. If the server sends raw counts rather than engineering units, configure raw/eng ranges on the tag — once, here, instead of in every widget.


Step 8 — Verify​

  • All four tags show Good quality
  • Values change as the equipment runs
  • The connection is healthy in the Connections list
  • Security is SignAndEncrypt and still working
  • Deadbands are set deliberately
  • Descriptions and units are filled in

What comes next​

NextWhy
Build a dashboardPut these tags on a screen
Alarm on a tagReact when Fault goes true
User-defined typesDo the next nineteen motors in minutes
Log data to SQLGet this data into a report
Before the second motor, build a UDT

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