^BX Data Matrix Barcode
Prints a Data Matrix symbol, a two-dimensional code of square modules inside a perimeter finder pattern, from the data of the next field.
^BXo,h,s,c,r,f,g,a
^BX parameters
| Parameter | Meaning | Accepted values | Default |
|---|---|---|---|
oorientationp. 144 |
Direction in which the symbol is rotated. |
|
The current |
hdimensional height of individual symbol elementspp. 144, 146 |
Size of one square element of the symbol; it sets both the module size and the row height. The guide does not name the unit in this entry; it speaks of elements and of symbol height. |
From 1 up to the width of the label. |
If the parameter is zero or not given, the |
squality levelp. 144 |
How much error-correction data is added to the symbol. The guide equates it with the ECC value of the Data Matrix specification. The guide recommends ECC 200 for new applications. It limits ECC 000 to 140 to closed systems in which a single party both prints and reads the symbols and answers for how the whole system performs. |
|
0
|
ccolumns to encodep. 144 |
Forces the number of columns of the symbol; the printer otherwise chooses the number of rows and columns. Forcing a larger size can give a uniform symbol size. For quality 0 to 140 the symbols are square, so the larger of the rows and columns values is used for both. If the data cannot fit the forced size, no symbol is printed. A value above 49 sets the rows or columns value to zero and the size is determined normally. An even value is said to generate INVALID-P. A value below 9 but not 0, or data too large for the forced size, prints no symbol, and with^CV active INVALID-L is printed.
|
Odd values only for quality 0 to 140 (10 to 144); even values only for quality 200. |
Not stated in the guide. |
rrows to encodep. 144 |
Forces the number of rows of the symbol. The guide's explanatory text for forcing the size is printed under the columns parameter and refers to rows and columns together. |
|
Not stated in the guide. |
fformat ID (0 to 6), not used with quality set at 200pp. 145, 146 |
Declares which character set the field data uses, for quality 0 to 140 symbols. For quality 0 to 140 the field data must agree with the format ID or no symbol prints; with^CV active INVALID-C is printed.
|
|
6
|
gescape sequence control characterpp. 145 to 147 |
The character that introduces special control sequences inside the field data of a quality 200 symbol. FirmwareUnderscore as the control character: V60.13.0.12, V60.13.0.12Z, V60.13.0.12B, V60.13.0.12ZB, or later. |
Any character. Used only with quality 200. A value must always be specified when using this parameter: if no value is entered the command is ignored. |
The table gives the tilde (~). For firmware V60.13.0.12, V60.13.0.12Z, V60.13.0.12B, V60.13.0.12ZB or later the guide says the underscore (_) is the control character, and page 146 calls the underscore the default for quality 200 field data. |
aaspect ratiop. 145 |
Whether the symbol is square or rectangular. FirmwareSupported only in V60.16.5Z and V53.16.5Z or later. |
|
1
|
^BX notes and gotchas
-
Interaction
Effect of
pp. 144, 146^BYon^BX: the module width and the ratio have no effect; only the^BYheight is used, and only as an approximate symbol height when the^BXelement size is zero or missing. -
Interaction
For quality 200, if
p. 146^FHis used, hexadecimal processing happens before the escape sequence processing. -
Firmware
Escape sequences in quality 200 data, firmware V60.13.0.12, V60.13.0.12Z, V60.13.0.12B, V60.13.0.12ZB or later: they start with the underscore or the g character. _X is a shift for control characters (for example _@ is NUL, _G is BEL, _0 is PAD). _1 to _3 give FNC characters 1 to 3 (explicit FNC4 is not allowed). FNC2 (structured append) must be followed by nine digits made of three three-digit numbers between 1 and 254 for the symbol sequence and file identifier. A code page is written as 5 followed by a three-digit number. _dNNN gives the ASCII decimal value NNN for a code word (three digits). An underscore in the data is written as two underscores.
Firmware: V60.13.0.12, V60.13.0.12Z, V60.13.0.12B, V60.13.0.12ZB, or later p. 147 -
Firmware
Escape sequences in quality 200 data, all other firmware versions: the same set of sequences, introduced by the tilde or the g character instead of the underscore (
Firmware: All firmware versions other than those listed for the underscore form p. 147~X,~1to~3, FNC2 with nine digits, 5 plus a three-digit code page,~dNNN). -
Note
The print ratio is fixed.
p. 1588 -
Note
Maximum field data for quality 0 to 140 depends on the quality and the format ID. The guide's table gives, for ID 1 to 6: quality 0: 596, 452, 394, 413, 310, 271; quality 50: 457, 333, 291, 305, 228, 200; quality 80: 402, 293, 256, 268, 201, 176; quality 100: 300, 218, 190, 200, 150, 131; quality 140: 144, 105, 91, 96, 72, 63. Field data is limited to 596 characters for these qualities, and more data prints no symbol (INVALID-L with
pp. 145, 146^CVactive). -
Note
For quality 0 to 140, the sequence \& inserts a carriage return and line feed and a second two-character sequence inserts a backslash, as in PDF417. Other control characters can be inserted only with
pp. 82, 146^FH. -
Note
For quality 200, field data longer than 3072 bytes is truncated to 3072 bytes. The guide says this limits a numeric symbol to less than the 3116 digits the specification allows, and gives maximum capacities of 2335 alphanumeric characters and 1556 8-bit bytes.
p. 146
Where the guide contradicts itself (6)
-
Guide issue
The default of g is stated three ways: the tilde in the parameter table (page 145), the underscore as the default for quality 200 (page 146), and a split by firmware version (pages 145 and 147). The guide's firmware split is the only rule that decides between them.
pp. 145 to 147 -
Guide issue
Parameter c is given as 9 to 49 with odd values only for quality 0 to 140 (shown as 10 to 144) and even values only for quality 200, yet the same text says an even value generates INVALID-P without saying that this applies only to quality 0 to 140. Neither c nor r has a stated default. The 10 to 144 range is not explained.
p. 144 -
Guide issue
The label of parameter f reads format ID (0 to 6), but only the values 1 to 6 are listed, and the descriptions of 2 and 4 are almost the same (both upper-case alphanumeric and space).
p. 145 -
Guide issue
Page 146 says the maximum field sizes for quality 0 to 140 are in the table in the g parameter, but the table is printed after the a parameter on page 145. The same page prints the backslash sequence as two vertical bars where the PDF417 entry writes it as two backslashes.
pp. 82, 145, 146 -
Guide issue
In the escape-sequence lists the code page is written 5NNN with no leading control character, although the examples beside it show the control character before the 5 (_5009 and
p. 147~5009). The tilde list also says a tilde in the data is encoded by a tilde, without saying whether it is doubled. -
Guide issue
Page 144 says the h parameter of
pp. 144, 146^BXsets the element size and that the^BYheight is used as an approximate symbol height only when h is zero or absent. Page 146 describes the case in which the element dimensions are not specified in^BY, although^BYhas no element-size parameter and its module width has no effect on^BX.
^BX example
^XA ^FO40,40^BXN,6,200^FDPART-4471^FS ^XZ
A quality 200 (ECC 200) Data Matrix symbol, not rotated, with elements of size 6. The size parameters c and r are left out so that the printer chooses the symbol size, and the data contains no underscore or tilde.
Guides that use ^BX
BarcoderX is a .NET SDK for thermal labels and barcodes. See the barcode types it covers.
Source Zebra, ZPL II, ZBI 2, Set-Get-Do, Mirror, WML Programming Guide, P1134473-11EN Rev A, 2026/07/05, pages 82, 144 to 147, 167, 190, 193, 208, 1588.
Written by BarcoderX in its own words. Checked against the guide on 2026-11-14.
ZPL and ZPL II are trademarks of Zebra Technologies Corporation. This reference is written by BarcoderX in its own words from Zebra's published programming guide. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.