TBarcode2D_Code16K

The component is used to create the Code 16K 2D Barcode symbols. It's defined in the pCode16K unit.

Code 16KCode 16K was developed by Ted Williams in 1989 to provide a simple to print and decode multiple row symbology. It's a continuous, variable-length, stacked 2D barcode symbology that can encode the complete ASCII 128-character set. Extended ASCII characters (ASCII value 128 to 255) may also be encoded by using function character.

Each Code 16K symbol contains from 2 to 16 rows. Each row is divided by a separator bar. The top and bottom of the symbol also have separator bars that extend to the ends of the minimum quiet zones.


Symbol size

Each Code 16K symbol contains from 2 to 16 stacked rows, with 5 ASCII characters per stacked row. The RowHeight property can be used to specify the height for each stacked row, in modules. The data capacities are listed in following table:

RowsMaximum data capacities
Numeric charactersASCII characters
2147
32412
43417
54422
65427
76432
87437
98442
109447
1110452
1211457
1312462
1413467
1514472
1615477

You can use the MinRowsand the MaxRows properties to specify the minimum and maximum number of stacked rows for a Code 16K symbol. They can be one of values from 2 to 16 (defined in the pCode16K unit). The smallest number of symbol stacked rows that accommodates the barcode text will be automatically selected between minimum and maximum number of stacked rows.

If the barcode text does not fill the maximum data capacity of the Code 16K symbol, remaining data capacity of the symbol will be filled by adding the PAD characters automatically. If the barcode text is so long that it cannot be encoded using the maximum number of stacked rows specified by the MaxRows property, an OnInvalidLength event will occur. You can use the CurrentRowsproperty to get the factual number of stacked rows.

The Code 16K symbol width is 81 modules (inclusive of minimum leading quiet zone and trailing quiet zone). The minimum row height value is 8 times the module width. So the smallest Code 16K symbol is 81 * 19 modules square and the largest is 81 * 145 modules square (inclusive of minimum quiet zones, the row height is set to 8 modules, and the separator bar height is set to 1 module).

The minimum value of the module width is 7.5 mils (0.19 mm). So the minimum physical size is 15.4mm * 3.6mm. The maximum data density is 208 alphanumeric characters per square inch or 417 numeric digits per square inch when the symbol is printed at 7.5 mils.


Quiet zones

The leading quiet zoneshall be a minimum of 10 modules, the trailing quiet zone shall be a minimum of 1 modules. No top quiet zoneand bottom quiet zone are required outside the bounds of the symbol.

So the minimum value of LeadingQuietZone property is equal to 10, the minimum value of TrailingQuietZone property is equal to 1, and the minimum value of TopQuietZone, and BottomQuietZone properties are equal to 0.


Character set


Initial modes

Code 16K has initial modes which are used to specify the initial code set and may also represent an implied leading FNC1 character or implied leading SHIFT B character as shown in following table. The code set will be automatically switched if a character is encountered that cannot be encoded by current code set. And implied characters function as if they were actual symbol characters but don not occupy any space.

There are seven kinds of initial mode, from 0 to 6, and a kind of extended data length mode. The initial mode values from emCodeA to emExtended, corresponding to these modes, are defined in the pCode16Kunit. These modes and their values are listed in following table:

Initial ModeValueInitial code setImplied characterDescription
0emCodeAA(None)The code set will be automatically switched if another code set character is encountered.
1emCodeBB(None)
2emCodeCC(None)
3emCodeB_FNC1BFNC1
4emCodeC_FNC1CFNC1
5emCodeC_Shift1BCSHIFT BFirst character excepting the message append block (if exists), must be code set B character (ASCII 32 - ASCII 127), otherwise an OnInvalidChar event will occur. The code set will be automatically switched if another code set character is encountered.
6emCodeC_Shift2BCDouble SHIFT BFirst two characters excepting the message append block (if exists), must be code set B characters (ASCII 32 - ASCII 127), otherwise an OnInvalidChar event will occur. The code set will be automatically switched if another code set character is encountered.
Extended data length modeemMode_ExtendedBNoneIndicates to create a Code 16K barcode symbol in extended data length mode. An extended data length mode block is required, and it should be placed at beginning of barcode text, otherwiset the OnInvalidCharevent will occur. See also the "Extended data length mode" section below.

The InitialModeproperty can be used to specify the initial mode for a Code 16K symbol. It can be one of values shown in table above, corresponding to the initial modes 0 to 6, and the extended data length mode. Also, it can be set to emAuto (defined in the pCode16Kunit), in this case, one of values from emCodeA to emModeC_Shift2B, corresponding to the initial modes 0 to 6 shown in table above will be selected automatically, depending on the barcode text, in order to minimize the symbol size.

You can always use the CurrentMode property to get the factual initial mode.


Escape sequences

If the AllowEscape property is set to true, following escape sequences are supported by the component, you can insert them to the barcode text:


Extended data length mode

The extended data length mode is used to encode data beyond the capacity of a single Code 16K symbol. In the extended data length mode, up to 107 Code 16K 16-rows symbols may be arranged to convey more data (up to 8025 ASCII characters, or 16050 numeric digits). If a symbol is part of these extended data length mode symbols, this shall be indicated by extended data length mode block in barcode text. The escape sequence "\m[<Index>, <Amount>]" is used to place the extended data length mode block to the barcode text:

The AllowEscape property should be set to true in order to place the extended data length mode block. The extended data length mode block may be placed only once in the barcode text. Also, it shall be placed at beginning of the barcode text. The OnInvalidChar event will occur if the extended data length mode block be placed more than once, or it isn't placed at beginning of the barcode text. The following is an example of extended data length mode symbol:

\m[2,12]ABCDEFG1234567

The InitialModeproperty should be set to emAuto or emMode_Extended if an extended data length mode block is placed in the barcode text, otherwise the OnInvalidChar event will occur. Conversely, the extended data length mode block is required if the InitialMode property is set to emMode_Extended, otherwise the OnInvalidChar event will occur too.

The extended data length mode block shouldn't be placed together with message append block in the barcode text, otherwise the OnInvalidChar event will occur. See also the "Message append (structured append)" section below.

If a symbol is encoded in extended data length mode, the number of stacked rows will be changed to 16 automatically.

Note, if only two symbols are to be logically linked in extended data length mode, they may be arranged horizontally or vertically adjacent to each other. If more symbols are to be logically linked, they shall be arranged in a single vertical stack. The maximum number of symbols should be specified for the application.


Message append (structured append)

The message append is a method similar to the extended data length mode to encode data beyond the capacity of a single Code 16K symbol. Up to 9 Code 16K symbols may be appended in a structured format to convey more data. It should only be used in closed systems. If a symbol is part of a message append this shall be indicated by a message append block in barcode text. The escape sequence "\s[<Index>, <Amount>]" is used to place the message append block to the barcode text:

The AllowEscape property should be set to true in order to place the message append block. The message append block may be placed only once in the barcode text. Also, it shall be placed at beginning of the barcode text. The OnInvalidChar event will occur if the message append block be placed more than once or it isn't placed at beginning of the barcode text. The following is an example of message append symbol:

\s[2,5]ABCDEFGHIJKLMN012345

The message block shouldn't be placed together with extended data length mode block in the barcode text, otherwise the OnInvalidChar event will occur. See also the "Extended data length mode" section above.

The message append block shouldn't be placed in the barcode text if the InitialMode property is set to emMode_Extended, otherwise the OnInvalidChar event will occur.

The symbols in a message append should not be arranged horizontally, but only in a single vertical stack.


Properties:

Methods:

Events:

Contents