GS1 barcode parsing - It seems that there is no separating character

3.4k views Asked by At

I have a program for parsing GS1 Barcodes (with Zebra scanner), which worked just fine, atleast I thought it was OK... Until I came across one box with 2 GS1 barcodes.. one "linear" and one data matrix (UDI). For linear, it worked just fine, I successfully got out the GTIN and Serial. But datamatrix is different. For some reason, its content is a bit longer than linear code, it has some production date and something else at the end.

This is the Linear code: (01)00380652555852(17)260221(21)25146965079(30)1 This is data matrix: (01)00380652555852(17)260221(21)2514696507911210222240SA60AT225

I have problems with parsing out the Serial number - 25146965079. Serial number in GS1 has a length of 1-20 characters. This one has 11, but How can I make it stop after the 9 characters? How can I know that the serial ends there? I tried transforming each character to UDI, but it seems that there is no special separating character or anything.. so I honestly donjt know what to do. Does anyone have any idea?

This the code, if anyone wanna try anything https://prnt.sc/1x2sw8l

Those codes/products came right from the manufacturer, so there shouldnt be anything wrong with the code, I guess...

4

There are 4 answers

2
MyICQ On BEST ANSWER

If you verify the barcode with a scanner that is designed to interpret a GS1 structure, you will see that the generated barcode is in fact incorrect.

You are missing a GS after the serial number, these codes MUST end a variable-length field if it's not the last one. This is specified in GS1 general specifications section 7.8.5.2

Without this separator you can't know where the serial ends - or, a machine interpreting the code can't know.

Tell the manufacturer that they need to study the GS1 specs.

Edit: the "correct" version would be:

(01)00380652555852(17)260221(21)25146965079<GS>(11)210222(240)SA60AT225

The parentheses and group separator <GS> are not included literally in the code.

Since you have two variable-length identifiers (21) and (240) you need a GS no matter what you do. Only alternative would be to have some padding for serial number, then you could do without separator.

3
Juan Sturla On

According to the GS1 documentation (page 156 and forwards)

All the fields are correct

(01)00380652555852 --> GTIN

(17)260221 --> Expiration date

(21)25146965079 --> Serial Number

(11)210222 --> Production Date

(240)SA60AT225 --> Additional Product Identification

I tried scanning the image but the result was the same as yours.

So the problem is that the separators are not there. Which is a problem for you, and there is no way to know where the serial number ends without the separator.

1
Sheikh Rehman On

store raw input in KeyPress event and then read the character for Letter Or Digit.

        if (e.KeyChar != 13)
        {
            int asci = Convert.ToInt32(e.KeyChar);
            if (asci > 31 && asci < 128) // numeric and chars only
                rawbcode += Convert.ToChar((int)(e.KeyChar & 0xffff));             
            else
            {
                if (asci == 29)
                {
                    rawbcode += "<GS>"; // GS1 Seperator    
                }
            }
        }
0
abobaker ezzat On

I am sorry my English is not good The reason of this problem is group separetors are unreadable character for example if you focus on text box and press capslock button or shift button nothing appear in text box the same in gs To solve this problem Public l as integer And put the following code in keyup event

If textbox1.textlenght = l then
My.combuter.keybord.sendkeys({enter})
L= textbox1.textlenght
End if

This code will give space after each litter (because each litter combined with cabslock button) and five spaces in groub space