Higher level decode/encode (ignition >=7.7.0)

Here is a higher level barcode decode (and encode) using the barcode controller. (For ignition 7.7)

Rather than having to tweak the barcode parsing for each end use application, I wanted a more generic solution that interprets a wide range of barcodes and then simply returns parsed information for me to deal with.

In particular wanted to be able to handle retail, SSCC and GS128 codes.

It also provides a single global spot to manage all extra barcode regex from.

I noted that for single pass parsing all rules were of form ^$. This makes it possible to distinguish between SinglePass and Consume regex.

There are two files - barcode_functions.py (code) and barcode_partial.proj (a test window).

The barcode controller may have to be adapted to different (pre|post)ambles and separator fields to suit your scanner. (I use STX,ETX for the ambles to avoid conflicting with operator typing). You can totally ignore the pattern config on the controller - it is not used :slight_smile:

The test shows the result from the parse as well as reproduces an equivalent barcode on screen if it is handled. I have tested with GTIN-8,GTIN-13 as well as various other GS1 codes eg SSCC and other info codes including variable length fields.

I had issues exporting global functions out of 7.7.0 hence you will have to recreate “shared/barcode/functions” script object in global namespace and cut and paste the contents of the .py file into it.

You will also require barcode scanner module installed and running on server.
barcode_functions.py (4.13 KB)
barcode_partial.proj (13.1 KB)

Hello, Please Could you send me the files? The links are not working
Thanks in advance