Overview AutoLab4j

From Commander4j

AutoLab4j is an automated label printing and SSCC generation service for production lines. It monitors Modbus digital signals from production equipment, reads product data from CSV files exported by Commander4j, generates ZPL labels, sends them to networked Zebra printers over TCP/IP, and produces Production Declaration XML documents for each pallet printed.

Purpose

When a pallet is complete on a production line, the line's PLC or I/O module raises a Modbus coil signal. AutoLab4j detects this signal, generates a unique SSCC (Serial Shipping Container Code), builds the ZPL label from the active product data and label template, and sends it to the printer — all without any operator interaction.

This separates label printing from the Commander4j desktop application and ties it directly to the physical production event rather than a manual operator action.

Difference from LabelServer4j

AutoLab4j and LabelServer4j both print labels from Commander4j data, but serve different roles:

Feature AutoLab4j LabelServer4j
Typical use Pallet labellers Case and secondary labellers
Print trigger Modbus coil signal from production line equipment CSV file placed by Commander4j
SSCC generation Yes — generates unique SSCCs automatically No — SSCC is supplied in the CSV
User interface Graphical window with per-line status displays None — background service only
Output documents Produces Production Declaration XML per pallet No output documents

How It Works

  1. Commander4j writes a CSV data file to the configured dataset directory when an operator assigns a process order to a production line.
  2. AutoLab4j monitors that directory. When a CSV file appears, it reads the product data into memory.
  3. AutoLab4j polls the Modbus coil address for the production line every 250 ms.
  4. When the coil signal matches the configured trigger value, AutoLab4j reads the semi-pallet coil to determine whether this is a full or semi pallet.
  5. For each SSCC in the pallet, AutoLab4j generates a unique SSCC number, builds the ZPL label from the template, and sends it to the printer over TCP/IP (port 9100).
  6. After printing, a Production Declaration XML file is written to the output directory.
  7. The SSCC sequence number is incremented and persisted to disk.

SSCC Generation

SSCC numbers are generated from a configurable prefix and an incrementing sequence number. The sequence is stored in a per-printer XML file and updated atomically after each print. When the sequence approaches the configured warning limit, AutoLab4j sends an email alert. When it reaches the upper limit, printing stops until the sequence file is reset.

Pallet and Semi-Pallet Support

Two Modbus coil addresses are used per production line:

  • A primary coil that signals a pallet is complete and a label should be printed
  • A semi-pallet coil that determines whether this is a full pallet or a semi-pallet

Full pallets and semi-pallets can be configured with different quantities of SSCCs per pallet and labels per SSCC.

Supported Printer Types

AutoLab4j communicates with printers using ZPL (Zebra Programming Language) over raw TCP/IP sockets. Any printer that accepts raw ZPL on a configurable IP address and port is supported.

Multi-Line Support

AutoLab4j supports multiple production lines simultaneously. Each line runs its own independent set of threads (dataset monitor, Modbus poller, print handler) and has its own system tray icon showing the current status.

Label Preview

If enabled, AutoLab4j calls the Labelary web API to render each ZPL label as a PNG image and displays it on screen before sending to the printer. This provides a visual confirmation that the correct label is being printed.

Production Declaration Output

After each pallet is printed, AutoLab4j writes an XML Production Declaration file to the configured output directory. This document records the SSCC, product, batch, shelf life, and other details for downstream integration.

See also: AutoLab4j Configuration, AutoLab4j Operation, AutoLab4j Dataset CSV, LabelServer4j