Skip to content

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 ​

  1. Add Device → Auxiliary Devices → Barcode / QR Scanner or Weigh Scale.
  2. 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.
  3. 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.
  4. 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 ​

TagTypeValue
last_scanstringThe most recent code, with strip_prefix/strip_suffix removed
scan_countintScans since the driver connected (resets on reconnect)
last_scan_timestringISO time of the last scan
commandstring, writableWriting 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 ​

TagTypeValue
weightfloatFirst number found in the line
unitstringkg, g, lb, oz or t after the number; otherwise unit setting (default kg)
stablebooltrue if the line contains ST, false if it contains US
rawstringThe line exactly as received
last_updatestringISO time of the last line
commandstring, writablee.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:

KeyDefaultUse
delimiter\nLine end in TCP mode. Many scanners end with \r. (Serial mode always reads to \n.)
tx_delimiter\r\nAppended to commands.
strip_prefix, strip_suffixnoneRemove AIM identifiers or fixed text from scans.
weight_regexnumber + optional unitRegular expression; group 1 = weight, group 2 = unit.
stable_token, unstable_tokenST, USStability markers.
encodingutf-8Text 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 ​

SymptomCauseFix
TCP scanner connects but last_scan never changesScanner ends lines with CR only.Set delimiter to \r.
Serial device shows garbage in rawWrong baud rate or parity.Use Help me find it; the driver uses 8-N-1.
Could not list serial portsDriver service not running.See Driver Health.
Device drops to Disconnected after the scanner sleepsThe TCP connection closed; the driver reconnects on the next retry.Disable the scanner's idle disconnect.

See also ​

Scada.Ink Help Center