Problem and prerequisites
A readable code can coexist with the wrong printed date or lot. This test assumes a device or application that exposes OCR and decoded results; confirm those functions rather than assuming every code reader provides them.
Prepare the test
Define the product’s required fields, permitted date format and authoritative batch record. Preserve leading zeros and meaningful separators. Use separate regions for printed text and code, linked by the same part event.
Specify the fields that the station must validate, such as lot and date, and identify the authorized source for each field. Agreement between printed text and a barcode is insufficient if both were generated from the wrong batch record. Capture the reference revision used for the event so that a later schedule change does not rewrite its meaning. Confirm the expected text language, character set, field length and date convention before training or configuring recognition. Prepare representative fonts, printing methods, substrate reflections and label placements. Verify that the proposed device exposes the raw recognition and decoding outputs needed for investigation; this workflow does not establish a supplied reader’s OCR functionality.
Procedure
- Create known matching samples and deliberately change one date, lot or serial field.
- Locate both regions and retain raw OCR text and the original decoded payload.
- Parse only the documented payload layout; normalize permitted spacing without rewriting uncertain characters.
- Compare every required field against the authorized reference and return a separate mismatch reason.
- Test missing text, unreadable code and unavailable reference data; none may default to a pass.
Build a controlled test set whose expected fields are prepared independently of the recognition system. Keep a clearly correct sample as the baseline. Change one field to create a wrong lot, then a wrong date, while retaining the other field. Remove printing without removing the barcode, and prepare ambiguous characters without inventing a correction rule. Test a missing or unavailable reference separately from an unreadable print. Observe raw recognized text, decoded contents and validation reasons for each event. If the station only outputs a final pass flag, add application-level records or revise the interface requirement; that flag alone cannot show whether text, code and reference were actually compared.
Illustrative test record
Illustrative assumptions, not measured Deyi performance. Replace these values with your own signed test records.
| Record | Assumed value |
|---|---|
| Sample count | 6 |
| Expected regions | 2 |
| Trigger identifier | T120 |
| Recipe version | O3 |
For T120, retain three separate fields: raw printed text, raw decoded payload and the authorized reference value. Define permitted normalization, such as surrounding whitespace, before running the six planned cases. Include matching data, differing lot, differing date, missing print, ambiguous character and unavailable reference. A mismatch and an unreadable field need distinct reasons. Do not use the barcode to silently replace OCR text and then claim that the two agreed.
Parse data using a documented field schema rather than comparing arbitrary whole strings. Keep the original strings alongside parsed values. Allow only normalization approved for the field: stripping surrounding whitespace may be legitimate, while substituting a letter for a digit can conceal a wrong mark. A checksum, when available, checks a particular data structure and does not prove that the data matches the production order. Record the independent reference lookup result and its version. If either required input is unreadable or the reference is unavailable, the event cannot be declared consistent simply because the other input looks plausible. Give mismatch, unreadable input and unavailable reference distinct final reasons for operators and downstream handling.
Two views of the workflow
Check OCR text against barcode and batch data — 1
OCR and decoded payload enter independent parsing paths before meeting the same authorized reference.
- Printed text
- Code payload
- Field parsing
- Reference check
Check OCR text against barcode and batch data — 2
Missing evidence, mismatched values and unavailable reference data are distinct outcomes; all need a defined disposition.
- Missing field
- Mismatch
- Reference fault
Troubleshooting
- A confusion such as O/0 requires better images or a review decision, not an automatic invented correction.
- A date interpreted with the wrong regional order requires an explicit product format.
- A stale batch reference requires version checking and a controlled fault.
Acceptance and handover
Run all 6 assumed cases and inspect the reason attached to each part. Release only complete, matching fields. Record the batch-reference version and recipe alongside evidence; confirm that a reference outage prevents release.
Set acceptance limits before testing and retain the original evidence. The examples here do not establish a supplied model’s capabilities.
Acceptance should use an expected decision for every planned case and compare it with the stored final reason. Confirm that a wrong lot or date is blocked even when both channels return confident readings. Confirm that a lost reference prevents release according to the agreed containment rule, then verify recovery using the current authorized reference. Check that the recovered lookup does not silently modify an earlier failed event. Review the ambiguous-character sample with quality before permitting any normalization. Deliver the field schema, normalization rules, reference ownership, test images and decision matrix as one controlled configuration. The illustrative six cases describe functional coverage; they do not prove recognition accuracy across every font, language or production speed.
Sources and technical references
These references explain the methods and limits used in this tutorial. Example checks are guidance; production acceptance requires evidence from your own samples.
- Optical Character Reading and 1D/2D Code VerificationKEYENCE
Combining OCR and code reading for traceability; no claim of equivalent Deyi functionality.
Checked - Deep Edge AI Code Reading for Inline TraceabilityLMI Technologies
Separates decoding, text extraction, data validation and production outputs.
Checked
Component and selection references
- Packaging Label and Barcode Inspection System
- Food and Beverage Cap Label Date Code Inspection
- Barcode & Traceability
- Industrial Barcode Readers
- Industrial Barcode Reader Selection Guide
- What Is DPM Barcode Reading?
- DPM Code Reading on Reflective Metal Parts
- Packaging Label and Barcode Traceability
- Direct Part Mark Code Reading on Metal Parts
- Cognex DataMan Alternative
- Datalogic Barcode Reader Alternative
- Omron Microscan Barcode Alternative
- Zebra Fixed Scanner Alternative
- Logistics Barcode Sorting
- Printing and Label Inspection
- EAN-13 traceability: line acceptance
- EAN-13 traceability: decode and data rules
- EAN-13 traceability: camera sampling
- EAN-13 traceability: lighting and quiet zones
- EAN-13 traceability: duplicates and missing reads
- Track barcode results to the correct conveyor reject
- Multiple codes: region rules and duplicate-read control

