Dear VPE users,
I'm happy to share with you some useful tips I use in order to generate correct GS1-128 (EAN-128) with VpeBarCode() function and BCT_EAN128 code type.
One crucial point is where to place the control character FNC1, depending on the Application Identifier (AI)
The 4 rules where to place the control character for a GS1-128 (EAN-128) barcode are the following ones :
1. Add the FNC1 character only for variable length AI, before the next AI to close the current AI.
2. Do not add the FNC1 character for fixed length AI.
3. Add the FNC1 character only for AI located in the beginning or in the middle of the bar code.
4. Do not add the FNC1 character for the last AI (even if it's a variable-length AI).
Example:
AI (01) is always 14 digits, so I don't have to add the FNC1 character.
AI (10) is between 1 to 20 alphanumeric car, so I have to add the FNC1 character at the end of the data (235590201).
AI (37) is between 1 to 8 digits, so it should have normally the FNC1 character, but the last AI in the bar code must not be followed by the FNC1 character.
So the correct string is "(01)12345678901234(10)1234<FNC1>(37)12"
With VPE, you should removed the parentheses:
VpeSetBarcodeAutoChecksum(hDoc, TRUE); VpeBarcode(hDoc, lCoordX+17.50, lCoordY+16.00, -10.20, -3.00, BCT_EAN128 , "011234567890123410ABCD<FNC1>3712","");
PS: VPE does insert a control character FNC1 at the beginning of the string when BCT_EAN128 code type is used, so you don't have to add one by yourself.
More info :
https://en.wikipedia.org/wiki/GS1-128
https://www.gs1.org/standards/barcodes/application-identifiers
Hope that could help someone.
Regards,
Jean-Pierre Leroy