TCP / UDP
For equipment that has no industrial protocol at all: bench scales, barcode and RFID readers, weather stations, laboratory instruments, serial devices behind an Ethernet gateway, and in-house protocols. QUBIQ opens the socket, splits the byte stream into messages, and lets you map fields to tags.
Configuration
| Field | Description |
|---|---|
| Name | Connection identifier. |
| Host | Device IP or hostname (for client role). |
| Port | Device port, or the port to listen on in server role. |
| Transport | tcp or udp. |
| Role | client — QUBIQ connects out. server — QUBIQ listens and the device connects in. |
| Frame mode | How the byte stream is split into messages. See below. |
| Delimiter | For delimiter framing: the terminator, e.g. \r\n, \n, \x03. |
| Frame size | For fixed-length framing: bytes per message. |
| Max message bytes | Hard cap; a message larger than this is discarded rather than buffered indefinitely. |
| Field delimiter | Splits a message into fields, e.g. , for CSV, \t, ;. |
| Field count | Expected number of fields. A message with a different count is rejected. |
| Writeable | Allows tags on this connection to send data to the device. |
| Connect timeout (ms) | Socket connect timeout. |
| Inactivity timeout (ms) | Reconnect if nothing is received for this long. |
Framing
A TCP stream has no message boundaries — framing is how you recover them. Getting this wrong is the usual cause of "half a reading" or "two readings stuck together".
| Frame mode | Use when | Notes |
|---|---|---|
| Delimiter | The device terminates each message (\r\n, \n, ETX) | The most common case. |
| Fixed length | Every message is exactly N bytes | Binary protocols with a fixed record. |
| None | UDP, where each datagram is already a message | Do not use for TCP. |
UDP preserves datagram boundaries, so framing is usually unnecessary — but UDP also loses datagrams silently and may reorder them. Do not use it for anything you must not miss.
Field mapping
With a field delimiter configured, a message is split and each field becomes addressable by index. A binding's address is the field index.
Message: "ST,GS,+ 12.345,kg\r\n"
Fields: 0="ST" 1="GS" 2="+ 12.345" 3="kg"
Tag Scale/Status → address 0
Tag Scale/Weight → address 2 (data type float)
Tag Scale/Unit → address 3
Field count is a cheap integrity check: a truncated or concatenated message has the wrong number of fields and is rejected rather than parsed into wrong tags.
Binding tags
| Field | Notes |
|---|---|
| Address | Field index, or the whole message for a single-value protocol. |
| Polling mode | subscribe for a device that pushes continuously; write for outbound-only tags. |
| Data type | Set it — text "12.345" becomes a number only if the tag says float. |
Writing to the device
With writeable enabled, writing a tag transmits its value on the socket. The framing configuration is applied on the way out: the delimiter is appended, or the payload is padded to the fixed length.
Use this for command protocols — tare a scale, trigger a reader, request a measurement.
Quality and liveness
A raw socket gives no quality information, so QUBIQ infers it:
| Condition | Quality |
|---|---|
| Message parsed, field present | Good |
| Socket down or reconnecting | Bad |
| Message rejected (bad field count, oversized) | Previous value retained, event logged |
| Nothing received within stale after | Uncertain / stale |
Set stale after on tags fed by a push-only device. Without it, a dead device is indistinguishable from a quiet one. → Tag properties
Security
Raw TCP/UDP has no authentication and no encryption. Anyone who can reach the port can send data that QUBIQ will parse into tags.
- Keep these devices on an isolated segment.
- In
serverrole, bind to a specific interface and firewall the port. - Never expose a
server-role TCP/UDP connection to an untrusted network. - Treat values from it as untrusted input: validate ranges on the tag, not just in the display.
Troubleshooting
| Symptom | Check |
|---|---|
| Values are truncated or concatenated | Wrong frame mode or delimiter. Capture the raw stream and look at the actual terminator. |
| Some messages ignored | Field count mismatch — the device emits a status message with a different shape. |
| Data stops after a while | Device closed the socket; set inactivity timeout so QUBIQ reconnects. |
Nothing at all, client role | The device may be a server-only device expecting QUBIQ to listen — switch roles. |
| Numbers arrive as strings | Set the tag's data type; leading spaces and + signs are handled on conversion. |
| Works then breaks after a firmware update | Vendors change delimiters and field order between versions. Re-capture. |