Appearance
Adding Barcode Scanners and Weigh Scales
Last updated
Barcode/QR scanners and weigh scales push text lines to Scada.Ink instead of answering polls. The driver keeps the connection open, stores the latest line, and publishes it as tags at the device's polling rate. Use them to start a workflow on a scan, record a lot number, or check a fill weight.
Adding one
- Add Device → Auxiliary Devices → Barcode / QR Scanner or Weigh Scale.
- Under Connection Type choose Network (TCP) for a scanner or scale with an Ethernet port, or a serial device on a serial-to-Ethernet gateway (Moxa, Lantronix); then enter IP Address and Port (default 9004 scanner, 4001 scale; use the gateway's TCP server port). Choose Serial (RS-232/USB) for a device plugged straight into the appliance; then pick the Serial Port and baud rate.
- Not sure which port? Click Help me find it — scan / weigh to detect, then scan a barcode or put weight on the scale within 60 seconds. The page listens on every serial port at your chosen baud rate and the other common rates (1200–115200) and selects the port and rate that received data, showing Detected /dev/ttyUSB0 @ 9600 baud — received: …. If nothing arrives: No data detected. Check the cabling and that the device is powered, then try again.
- Finish the wizard. Subscribe the tags you need from Browse Tags.
You can switch between TCP and serial later in Settings → Connection Settings.
Barcode / QR Scanner tags
| Tag | Type | Value |
|---|---|---|
last_scan | string | The most recent code, with strip_prefix/strip_suffix removed |
scan_count | int | Scans since the driver connected (resets on reconnect) |
last_scan_time | string | ISO time of the last scan |
command | string, writable | Writing sends the text plus CR LF to the scanner (e.g. a trigger command) |
Each line the scanner sends is one scan. Scanning the same code twice changes scan_count and last_scan_time but not last_scan — trigger on scan_count if repeats matter.
Weigh Scale tags
| Tag | Type | Value |
|---|---|---|
weight | float | First number found in the line |
unit | string | kg, g, lb, oz or t after the number; otherwise unit setting (default kg) |
stable | bool | true if the line contains ST, false if it contains US |
raw | string | The line exactly as received |
last_update | string | ISO time of the last line |
command | string, writable | e.g. Z zero, T tare, P print (depends on the scale) |
The defaults suit Mettler-Toledo-style continuous output such as ST,GS,+ 12.345 kg.
Optional settings (API)
Set through Advanced Driver Settings:
| Key | Default | Use |
|---|---|---|
delimiter | \n | Line end in TCP mode. Many scanners end with \r. (Serial mode always reads to \n.) |
tx_delimiter | \r\n | Appended to commands. |
strip_prefix, strip_suffix | none | Remove AIM identifiers or fixed text from scans. |
weight_regex | number + optional unit | Regular expression; group 1 = weight, group 2 = unit. |
stable_token, unstable_token | ST, US | Stability markers. |
encoding | utf-8 | Text encoding. |
Warning: Clicking Save Changes on the Settings tab of a scanner or scale replaces the driver configuration with just the connection type, port and baud rate, removing these extra settings.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
TCP scanner connects but last_scan never changes | Scanner ends lines with CR only. | Set delimiter to \r. |
Serial device shows garbage in raw | Wrong baud rate or parity. | Use Help me find it; the driver uses 8-N-1. |
| Could not list serial ports | Driver service not running. | See Driver Health. |
| Device drops to Disconnected after the scanner sleeps | The TCP connection closed; the driver reconnects on the next retry. | Disable the scanner's idle disconnect. |