Reading product codes in a MES or WMS: requirements and four ways to integrate
A MES in production and a WMS in the warehouse take product codes at every step: printing and inspection on the line, aggregation into cases and pallets, receiving, shipping. When codes come not from a barcode scanner but from a camera or an image, the system needs a recognition module. Below: what it must do and how to integrate it.
What the recognition module must do
- Exact code bytes. A GS1 code string must reach the system with its GS separators — otherwise it fails validation and does not match the export from the traceability system.
- Zero false reads. A wrongly read code is worse than an unread one: an unread code goes for a retake, a wrong one ends up in documents.
- A deadline per frame. The line does not wait: the module must answer within a set time even on a heavy frame and return what it managed to read.
- Code count check. For aggregation what matters is that every pack in the case was read — the system compares the number of codes with the expected one.
- Offline operation. Plant networks are often closed; the module must not depend on external services.
Our libraries dmr and unir are built for these requirements: 99.6% of production-line frames with no false reads, a configurable deadline per frame, all codes in an image in one call, and a license that works offline for its whole term.
Four ways to integrate
1. The library inside your program
A program at the line receives a frame from the camera and passes it to the library straight from memory. For C++, the static library (GCC on Linux, MinGW-w64 on Windows); for C#, Delphi, Go and MSVC, the dynamic library with a C interface; for Python, the PyPI package. The fastest option: no files, no network. Example in the article on DataMatrix in C++.
2. A recognition service on the line PC
If the MES should not know about the library, recognition runs as a separate process. The unir tool in service mode keeps the scanner alive and accepts image paths one per line:
unir --serve --codes 0 --root /data/frames
# request: /data/frames/0001.png
# response (tab-separated fields):
# /data/frames/0001.png 0 41.20 0104601234567893215Abc12Xyz!-<GS>93dGVz datamatrix
# #END#It is easy to put your own HTTP service or message queue on top of it in any language: the #END# line shows that the answer for an image is complete, even when there are several codes. The --root option prevents reading files outside the frames directory.
3. A container in Docker or Kubernetes
The same service, or your own program with the library, in a container with as many instances as you need. There is an instance license for this: the key is passed as a variable or a secret, no internet needed. Details in the article on licensing in Docker and Kubernetes.
4. The cloud API
For a WMS where codes come from photos taken by warehouse staff or suppliers and there are few of them, nothing needs installing: the image is sent in an HTTP request and the answer is JSON with the code text, exact bytes and parsed GS1 fields. 300 requests a month are free. Details in the API documentation.
Which option to choose
| Task | Option |
|---|---|
| A camera on a conveyor, dozens of frames per second | the library inside your program |
| Several lines, a MES in another language | a service on the line PC |
| Recognition as a shared company service | containers with an instance license |
| Receiving by photo, tens to hundreds of images a day | the cloud API |
We can build it for your system
If you need a ready module rather than parts — a recognition service for your MES or WMS, case aggregation from a single image, print inspection on the line, operation in a closed network — we build it as custom work. We start with a free assessment on your frames: you send 50–200 images, we tell you how many codes read today and what can be improved, and quote price and timeline after the assessment. More on the custom development page, or write about your task.
Chestny ZNAK is a trademark of CRPT LLC (ООО «Оператор-ЦРПТ»); GS1 is a trademark of GS1 AISBL. The product is not affiliated with or certified by their owners.