Skip to main content
Version: Next

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

Click Test. Green means QUBIQ reached the endpoint and authenticated. Save.

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: Binding → Add binding.

FieldValue
ConnectionPLC1
AddressThe NodeId from browse — or pick it from the tree
Polling modesubscribe
Sampling rate1000 ms
Deadband0 for now

Save, and confirm Enabled is on.

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. Test, and confirm tags return to Good.

Step 7 — Tune

Now make it efficient.

Deadbands. Set 0.5–1% of span on the analogue tags. This removes sensor noise from the network, the historian and every screen at once.

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

Sampling rates. Match the value's real dynamics, not the maximum possible:

Speed 1000 ms changes continuously
Current 1000 ms changes continuously
Running subscribe changes rarely; push is free
Fault subscribe changes rarely; latency matters

Stale-after. For subscription tags, set stale-after to a few times the expected update interval. A value that never changes is otherwise indistinguishable from a dead link.

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 and sampling rates 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