I need to create a barcode that contains HYPHEN symbol and the following value is an example 211212-PB00000658
the ZPL code generated is
^XZ
^XA
^MMT
^PW1343
^LL406
^LS0
^BY4,3,91^FT316,199^BCN,,Y,N
^FH\^FD>;211212>6-PB>500000658^FS
^PQ1,0,1,Y
^XZ
Can someone explain to me what this is >6-PB>5 and what the logic behind is ?
It's a character set change. Also notice the >;
in the beginning, to start with Subset C
(all numeric) instead of the default Subset B
. It allows to reduce the barcode size. You may compare these 2, the resulting barcodes contain the same information but the not compressed one is wider.
^XA
^BY4,3,91
^FT26,190^BCN,,Y,N
^FD211212-PB00000658^FS
^BY4,3,91
^FT26,390^BCN,,Y,N
^FH^FD>;211212>6-PB>500000658^FS
^XZ
Result:
From ZPL manual:
UCC/EAN-128 offers several advantages. It is one of the most complete, alphanumeric, one-dimensional symbologies available today. The use of three different character sets (A, B and C), facilitates the encoding of the full 128 ASCII character set. Code 128 is one of the most compact linear bar code symbologies. Character set C enables numeric data to be represented in a double density mode. In this mode, two digits are represented by only one symbol character saving valuable space. The code is concatenated. That means that multiple AIs and their fields may be combined into a single bar code. The code is also very reliable. Code 128 symbols use two independent self-checking features which improves printing and scanning reliability.
Your barcode explanation:
>;211212>6-PB>500000658
>; start code C (all numeric)
211212 numeric value
>6 invocation code, select subset character code B, allowing alphanumeric
-PB hyphen and PB characters
>5 invocation code, select subset character code C, all numeric again
00000658 numeric value
Reference: (see p.82 to 86)
https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf