In many cases, each of the supported code types can use one of several encoding schemes and error correction schemes. In addition, composite codes and GS1 Databar 1D codes are families of codes, with each member being a sub-type and typically having a different encoding scheme.
To read, grade, or write most code types, you must ensure that the proper encoding scheme is selected for your code model using McodeControl() with M_ENCODING; in some cases, M_ANY is supported. McodeDetect() can help you establish the encoding scheme if it supports the code type; for information, see the Automatically detecting the code type section later in this chapter. You can also train the encoding scheme using McodeTrain() with a sample set of your images. For information, see the Training read and grade operation settings section later in this chapter.
Note that, for best results, specify the encoding scheme when reading a Code 39 code type.
When reading or grading composite code types, both M_ENCODING and M_SUB_TYPE are used. M_SUB_TYPE allows you to specify multiple sub-types so that you can limit the number of sub-types that MIL tries to read or grade. For example, when dealing with a composite code, if you specify a sub-type of M_GS1_DATABAR_EXPANDED + M_EAN13, MIL reads your code more quickly because it will only look for these two family members as opposed to all the available sub-types.
The following table lists the encoding schemes supported by each 1D code type (except M_GS1_DATABAR):
Encoding scheme (M_ENCODING) |
1D code types (except GS1 Databar) |
||||||||||
M_INDUSTRIAL25, M_INTERLEAVED25, M_PHARMACODE, M_PLANET, and M_POSTNET |
|||||||||||
Yes |
Yes 1 |
Yes |
— |
— |
— |
— |
— |
— |
|||
— |
— |
— |
— |
Yes |
— |
— |
— |
— |
|||
— |
— |
— |
— |
— |
Yes |
— |
— |
— |
|||
— |
— |
— |
— |
— |
— |
Yes |
— |
— |
|||
— |
— |
— |
— |
— |
— |
— |
Yes |
— |
|||
— |
— |
— |
Yes |
Yes |
Yes |
Yes |
Yes |
— |
|||
Yes |
Yes |
— |
— |
— |
— |
— |
— |
— |
|||
— |
— |
— |
— |
— |
— |
— |
— |
Yes |
1 Note that M_ENC_ASCII is only available for M_CODE128 and M_EAN14.
The following table lists the encoding schemes and sub-types supported by the GS1 Databar code type (M_GS1_DATABAR):
Encoding scheme (M_ENCODING) |
Sub-type (M_SUB_TYPE) |
Image |
![]() |
||
![]() |
||
![]() |
||
![]() |
||
![]() |
||
![]() |
||
![]() |
The following table lists the encoding schemes supported by each 2D code type:
Encoding scheme (M_ENCODING) |
2D code types |
|||||
Yes |
Yes |
Yes |
Yes |
Yes |
— |
|
— |
Yes |
— |
— |
— |
— |
|
— |
Yes |
— |
— |
— |
— |
|
— |
Yes |
— |
— |
— |
— |
|
— |
Yes |
— |
— |
— |
— |
|
Yes |
— |
— |
— |
— |
— |
|
— |
Yes |
— |
— |
— |
— |
|
— |
— |
Yes |
— |
— |
— |
|
— |
— |
Yes |
— |
— |
— |
|
— |
— |
Yes |
— |
— |
— |
|
— |
— |
Yes |
— |
— |
— |
|
— |
— |
Yes |
— |
— |
— |
|
— |
Yes |
— |
— |
— |
— |
|
— |
— |
— |
— |
Yes |
— |
|
— |
— |
— |
— |
Yes |
— |
|
— |
— |
— |
Yes |
— |
Yes |
The following table lists the encoding schemes, 1D part, 2D part, and sub-types supported by composite codes. The supported composite codes have a 2D part that is either MicroPDF (CC-A or CC-B) or PDF417 (CC-C). The sub-type relates to the 1D part of the composite code, while the encoding scheme relates to both the 1D and 2D parts.
Encoding scheme (M_ENCODING) |
|||
1D part established by M_SUB_TYPE |
2D part |
||
M_EAN8 |
Yes |
— |
|
Yes |
— |
||
Yes |
— |
||
— |
Yes |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
||
Yes |
— |
In most cases, MIL can automatically detect the error correction scheme for read and grade operations. Similarly, MIL can automatically choose the best error correction scheme for most write operations. If your code type supports more than one error correction scheme and does not support M_ANY, you must specify the error correction scheme.
To specify the error correction scheme, use McodeControl() with M_ERROR_CORRECTION. If you specify a scheme that is not supported by your code type, MIL returns an error. If your code type uses a checksum, when a discrepancy exists between the calculated and stored checksum, the read operation will yield no results. You can also train the error correction scheme using McodeTrain() with a sample set of your images. For information, see the Training read and grade operation settings section later in this chapter.
The following table lists the error correction schemes supported by each 1D code type:
Code type |
Error correction scheme |
||
Yes |
— |
Yes |
|
Yes |
Yes |
— |
|
— |
Yes |
— |
|
Yes |
Yes |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
Yes |
— |
|
— |
Yes |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
The following table lists the error correction schemes supported by each 2D code type:
Code type |
Error correction scheme |
||||
Yes 2 |
— |
— |
— |
— |
|
Yes 3 |
Yes |
— |
— |
— |
|
— |
— |
— |
Yes |
— |
|
— |
— |
— |
Yes |
— |
|
Yes |
— |
Yes 4 |
— |
— |
|
Yes |
— |
— |
— |
Yes |
|
Yes |
— |
Yes |
— |
— |
|
Yes |
— |
— |
— |
Yes |
3 Note that M_ANY is not available for a Data Matrix code type when performing an McodeWrite() operation.
4 Note that M_MICROQRCODE does not support M_ECC_H.
McodeRead(), McodeGrade(), and McodeTrain() support occurrences of 2D code types (except M_MICROQRCODE) with an Extended Channel Interpretation (ECI) encoding. This is a piece of information embedded in a code occurrence that indicates that non-standard characters, such as Arabic or Mandarin characters, are used. To retrieve whether a code occurrence has an ECI encoding, use McodeGetResult() with M_IS_ECI.