Skip to Main Content
Cognex 支持中心
Logo

How to Distinguish Between UCC EAN-128 Codes and Generic Code 128 Codes via Scripting

This article is talking about how to distinguish between UCC/EAN-128 codes and generic Code 128 codes.

2026/01/29

Question

How to distinguish between UCC EAN-128 codes and generic Code 128 codes?

Answer

  1. The UCC/EAN-128 barcode, also called GS1-128, is a linear barcode symbology used to encode a wide range of data in a standardized format. It is part of the GS1 system, it is a subset of Code 128.

    When using scripting “decodeResults[0].symbology.name” for the two codes, both will return “Code 128” as symbology.

  2. Symbology identifier can be used to distinguish the two codes.

    ]C0 = Generic Code 128 identifier
    ]C1= UCC/EAN-128 identifier

  3. The scripting “ decodeResults[0].symbology.id” can get the " Symbology identifier" of the code.

    • For the Generic Code 128 code, it will be “]C0”.
    • For the UCC/EAN-128 code, it will be “]C1”.
    • Example scripting and results.
    How to distinguish between UCC EAN-128 codes and generic Code 128 codes via Scripting_Image-1

相关资源