Filters
Filter values by
Object Type
  • Code context
  • Code model
  • Code result buffer
Operation Type
  • Code read operation
  • Code grade operation
  • Code detect operation
  • Code train operation
    • Affects the results of training
    • Trainable or used for activating
  • Code write operation
Code Type
  • 1D code types
  • 2D code types
    • Cross-row code types (PDF)
    • Matrix code types (Aztec, Data Matrix, Maxi, QR)
  • Composite code types
| Customize Help
| Save Settings

McodeControl



Function Map
Synopsis
Control a code context, code model, or code result buffer setting.
Syntax
void McodeControl(
MIL_ID ContextOrResultCodeId, //in
MIL_INT64 ControlType, //in
MIL_DOUBLE ControlValue //in
)
Description

This function changes the setting of a specified code context, code model, or code result buffer.

Note that when using a C compiler (not a C++ or other compiler) in 64-bit mode, McodeControl() internally calls the MIL_DOUBLE version of this function (McodeControlDouble()). If you need to pass integer values, call the MIL_INT64 version of this function (McodeControlInt64()).
Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ContextOrResultCodeId

Specifies the identifier of the code context, code model, or code result buffer.

ControlType

Specifies the setting to change.

See the Parameter associations section for possible values that can be specified.

ControlValue

Specifies the setting's new value.

See the Parameter associations section for possible values that can be specified.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code context, to control an McodeRead(), McodeGrade(), or McodeTrain() operation. In this case, a code context must be passed to the ContextOrResultCodeId parameter.

Note that besides code type restrictions listed explicitly in the values below, McodeGrade() does not support M_4_STATE, M_PHARMACODE, M_POSTNET, and M_PLANET code types.

Although all these control types affect the results of McodeTrain(), see the description of the control types to determine if they can be activated for training; you can also use filters to limit the control types in the table to those that can be trained.

function map Code context settings for an McodeRead(), McodeGrade(), or McodeTrain() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_INITIALIZATION_MODE

Changes the initialization mode of the context; this changes the default of several code context and code model settings. The default value of the setting in each mode is indicated within the description of the control type. When you change the initialization mode, control types that have already been set to some value (other than default) are not changed. Instead, the initialization mode only changes those control values that are set to their default value (M_DEFAULT). INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_TYPICAL_RECOGNITION.

Click to summarize M_IMPROVED_RECOGNITION

Specifies a code context that might provide a more robust McodeRead(), McodeGrade(), or McodeTrain() operation. Note that this value is not recommended with M_PHARMACODE code types.

Note that when selecting this mode, the default of the affected code context and code model settings might change between MIL releases to improve robustness, given new features or standard recommendations.

(summarize)
Click to summarize M_TYPICAL_RECOGNITION

Specifies a code context that might provide a quicker McodeRead() or McodeGrade() operation.

Click to summarize M_MINIMUM_CONTRAST

Sets the minimum possible contrast between the foreground and background in the target image for 1D codes (excluding Planet and Postnet) when using the M_ADAPTIVE threshold mode.

Increasing the minimum contrast will typically improve McodeRead() operations, particularly in the presence of noise and non-uniform lighting. However, if the minimum contrast is higher than the contrast of a code, the code will not be read correctly.

For 2D codes, the minimum contrast is determined automatically, so the adaptive threshold mode does not use the M_MINIMUM_CONTRAST setting. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 50.

Click to summarize 1 <= Value <= 255

Specifies the minimum contrast. Only integer values are accepted.

(summarize)
Click to summarize M_SCANLINE_HEIGHT

Sets the height (or thickness) of the scan line. The scan line is the line along which the code occurrence is read.

When locating a code occurrence, the scan line is usually first taken across the middle of the image or the image's region of interest (ROI), if one is associated. If a code occurrence is not found, a scan line is taken either higher or lower in the image or its ROI.

This control type overrides the automatic selection based on the value of M_SPEED. In general, the higher the value for this control type, the slower the code is read. Higher values for this control increase the robustness of McodeRead(), McodeGrade(), and McodeTrain() operations. Using the default value is recommended; the higher the search speed, the lower the default value.

Note that during an McodeGrade() operation, after locating the code, when taking scan lines within the inspection band, MIL uses a scan line height of a single pixel regardless of the value of M_SCANLINE_HEIGHT, as per the ISO standard.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies that the scan line height is based on the value of M_SPEED.

Click to summarize Value

Specifies the scan line height, relative to the input coordinate system specified using M_SCANLINE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive. The value entered is rounded to the nearest integer.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_SCANLINE_INPUT_UNITS

Sets the units with which to interpret the M_SCANLINE_HEIGHT and M_SCANLINE_STEP control types. This essentially sets the input coordinate system to use.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead(), McodeGrade(), or McodeTrain() generates an error if the operation is not performed on a calibrated image.

(summarize)
Click to summarize M_SCANLINE_STEP

Sets the scan line step. The scan line step is the distance, or gap, between scan lines taken in the image or the image's region of interest (ROI), if one is associated.

In general, the higher the value for this control type, the faster the code is read, but the greater the chance of missing a readable line of code. Using the default value is recommended; the default value is dependent upon the search speed.

Note that during an McodeGrade() operation, after locating the code, when taking scan lines within the inspection band, MIL uses a scan line step distance based on the height of the inspection band and the required number of scan lines, regardless of the value of M_SCANLINE_STEP, as per the ISO standard; the ISO standard requires ten evenly spaced scan lines within the inspection band.

This control type is only available for 1D code types, Micro PDF417, and composite code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies that the scan line step is based on the value of M_SPEED.

When dealing with 1D code types and composite code types, the following values are associated with M_DEFAULT.

M_SPEED value

Default value

M_LOW

5

M_VERY_LOW

5

M_MEDIUM

10

M_HIGH

15

M_VERY_HIGH

25

When dealing with Micro PDF417 code types, the default value is 2, regardless of the value of M_SPEED.

(summarize)
Click to summarize Value

Specifies the scan line step, relative to the input coordinate system specified using M_SCANLINE_INPUT_UNITS.

When entering a value in pixel units, this value must be greater than or equal to 1. The value entered is rounded to the nearest integer.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_SEARCH_ANGLE_MODE

Sets whether to enable the search angular range algorithm for the code context.

When enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

For the M_AZTEC, M_DATAMATRIX, M_QRCODE, M_MICROQRCODE, M_MAXICODE, M_PDF417, and M_TRUNCATED_PDF417 code types, the angular range does not affect the speed of the operation.

In addition, if you expect that the codes sought are close to their nominal angle, you can try disabling the search angular range algorithm to see if the Code module can still find the required code occurrences. Disabling this algorithm might speed up the search depending on the code type and the target image.

Note that this control type is automatically activated for training if you activate M_SEARCH_ANGLE for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ENABLE.

Click to summarize M_DISABLE

Specifies that the search angular range algorithm is not used.

Click to summarize M_ENABLE

Specifies that the search angular range algorithm is used.

Click to summarize M_SPEED +

Sets the search speed. The faster the search speed, the less robust the operation.

For 1D code types, consider reducing the search speed when the pixel height of the bar code is small.

For 2D code types, consider reducing the search speed when the cell size is small relative to the image size.

For 1D code types, composite code types, and Micro PDF417, you can also affect the search speed by adjusting the value for M_SCANLINE_STEP.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is M_VERY_LOW.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_MEDIUM.

(summarize)
Click to summarize M_HIGH

Specifies a high search speed.

Click to summarize M_LOW

Specifies a low search speed.

Click to summarize M_MEDIUM

Specifies a medium search speed.

Click to summarize M_VERY_HIGH

Specifies a very high search speed.

Click to summarize M_VERY_LOW

Specifies a very low search speed.

Click to summarize M_STOP_READ

Stops the current McodeRead() or McodeGrade() operation being performed on the code context passed to ContextOrResultCodeId.

You must call McodeControl() with M_STOP_READ from another thread, typically of higher priority.

After making this call, the results returned to the result buffer of the McodeRead() or McodeGrade() operation are invalid and discarded.

(summarize)
Click to summarize M_DEFAULT

Implements the default behavior.

Click to summarize M_THRESHOLD_MODE +

Sets the threshold mode used to internally binarize the source image.

If the lighting is non-uniform across the code, use M_ADAPTIVE mode or process the image before performing the McodeRead() or McodeGrade() operation so that the background is strictly darker or strictly lighter than the code.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value for linear (1D) code types (except M_PHARMACODE) is M_GLOBAL_SEGMENTATION, and the default value for the remaining code types is M_ADAPTIVE.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_GLOBAL_SEGMENTATION.

(summarize)
Click to summarize M_ADAPTIVE

Specifies to use a fast dynamic local threshold. This mode selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood.

For linear (1D) code types (excluding Planet and Postnet), you must specify the minimum contrast (McodeControl() with M_MINIMUM_CONTRAST) between the foreground and background in the target image when using the M_ADAPTIVE mode.

For 2D codes, the minimum contrast is determined automatically, so the adaptive threshold mode does not use the M_MINIMUM_CONTRAST setting.

2D and 1D code types (excluding Planet and Postnet) are the code types that support M_ADAPTIVE.

(summarize)
Click to summarize M_GLOBAL_SEGMENTATION

Specifies to use a global threshold value. Specify the value using M_THRESHOLD_VALUE.

(summarize)
Click to summarize M_GLOBAL_WITH_LOCAL_RESEGMENTATION

Specifies that the source image will be globally thresholded and then the edges in the binarized image are resegmented according to the intensities of the surrounding bars and spaces in the original source image. These individual local thresholds, calculated per region, help enhance the edge positions in the code. Specify the global threshold value using M_THRESHOLD_VALUE.

This binarization method is compatible with the methods described in the various ISO code grading standards. For more information, refer to the Technical code information subsection of the Basic concepts for the MIL Code module section of Chapter 15: Codes.

This control value is available for all 1D code types (except M_4_STATE, M_POSTNET, and M_PLANET) and the M_MICROPDF417 code type.

(summarize)
Click to summarize M_THRESHOLD_VALUE

Sets the threshold value used to internally binarize the source image, depending on the specified threshold mode.

Note that if M_THRESHOLD_MODE is set to M_ADAPTIVE, this control type is ignored.

Note that this control type is automatically activated for training if you activate M_THRESHOLD_MODE for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO_COMPUTE.

Click to summarize M_AUTO_COMPUTE

Specifies the threshold value automatically.

Click to summarize 0 <= Value <= 255

Specifies the threshold value. Only integer values are accepted.

(summarize)
Click to summarize M_TIMEOUT

Specifies the maximum decoding time for an McodeRead() or McodeGrade() operation, in msec.

Note that this control type can still affect McodeTrain(). INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 2000 msec.

Click to summarize M_DISABLE

Specifies that there is no maximum decoding time.

Click to summarize Value >= 0

Specifies the maximum decoding time, in msec.

Click to summarize M_TOTAL_NUMBER

Sets the maximum number of code occurrences to read or grade in one source image. Note that this number is limited by the maximum number of occurrences of each code model to read or grade (M_NUMBER).

To avoid obtaining false positives when searching for a specific number of occurrences, set M_CODE_SEARCH_MODE to M_BEST. Note that M_BEST is not supported for 2D code types.

Only 1D code types (excluding GS1 Databar, 4-state, Planet, and Postnet code types) and the 2D Data Matrix code type support searching for multiple occurrences. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ALL.

Click to summarize M_ALL

Specifies to read/grade all code occurrences in the source image, up to the maximum number of occurrences to read/grade of each code model (M_NUMBER).

Click to summarize Value > 0

Specifies the maximum number of codes to read/grade in one source image. Only integer values are accepted.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified for a code context, to control an McodeGrade() operation. In this case, a code context must be passed to the ContextOrResultCodeId parameter.

Note that besides code type restrictions listed explicitly in the values below, McodeGrade() does not support M_4_STATE, M_PHARMACODE, M_POSTNET, and M_PLANET code types.

function map Code context settings for an McodeGrade() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_ABSOLUTE_APERTURE_SIZE

Sets the absolute size (diameter) of the aperture. Use this control type when using an absolute aperture mode (using M_APERTURE_MODE set to M_ABSOLUTE). INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.

Click to summarize Value >= 0

Specifies the absolute aperture size, relative to the input coordinate system specified using M_ABSOLUTE_APERTURE_SIZE_INPUT_UNITS.

Click to summarize M_ABSOLUTE_APERTURE_SIZE_INPUT_UNITS

Sets the units with which to interpret the M_ABSOLUTE_APERTURE_SIZE control type. This essentially sets the input coordinate system to use. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Click to summarize M_APERTURE_MODE

Sets the way in which the aperture size is determined. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_RELATIVE.

Click to summarize M_ABSOLUTE

Specifies to use the absolute aperture size, set using M_ABSOLUTE_APERTURE_SIZE.

Click to summarize M_DISABLE

Specifies to disable the aperture. Note that this is provided for backwards compatibility with older code. In this case, the McodeGrade() operation's returned results will more closely resemble the results of an McodeRead() operation.

(summarize)
Click to summarize M_RELATIVE

Specifies to use a relative aperture size, based on the cell size (using M_CELL_SIZE...) and the relative aperture factor (using M_RELATIVE_APERTURE_FACTOR).

Click to summarize M_DPM_CALIBRATION_RESULTS

Sets the expected reflectance and mean light values derived during the reflectance calibration phase.

This control type is an alternative to separately obtaining the reflectance and mean light values from the result buffer used during the reflectance calibration phase, and setting M_REFLECTANCE_CALIBRATION and M_MEAN_LIGHT_CALIBRATION to these two values, respectively, in the code context associated with the target code.

This control type is available for Aztec, Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize Result buffer identifier

Specifies the result buffer used during the reflectance calibration phase.

Click to summarize M_EXTENDED_AREA_REFLECTANCE_CHECK

Sets whether the grading must perform an additional reflectance check over an area containing the code occurrence and its extended area (that is, 20 times the cell size beyond the quiet zone on all sides).

This control type is only used for 2D code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies to disable the additional reflectance check.

Click to summarize M_ENABLE

Specifies to enable the additional reflectance check.

Note that you can only enable this control type when performing an ISO grading (that is, when M_GRADING_STANDARD is set to M_ISO_GRADING).

(summarize)
Click to summarize M_GRADE_QUIET_ZONE

Sets whether to include the quiet zone when performing an McodeGrade() operation.

This control type is only available for Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ENABLE.

Click to summarize M_DISABLE

Specifies to exclude the quiet zone.

Click to summarize M_ENABLE

Specifies to include the quiet zone.

Click to summarize M_GRADING_STANDARD

Sets the grading standard to use when performing an McodeGrade() operation. To specify a particular grading standard edition, use M_GRADING_STANDARD_EDITION.

The results of the McodeGrade() operation are dependent on the standard used; some control types have a different implementation or meaning depending on the standard used. These differences are outlined in the control types' description. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ISO_GRADING.

Click to summarize M_ISO_DPM_GRADING

Specifies to use an ISO/IEC TR 29158 specification. Note that this is the replacement for the AIM DPM-1-2006 standard.

This control value must be used at the beginning of the target grading phase, and should not be used during the reflectance calibration phase.

This control value is available for Aztec, Data Matrix, QR code, and Micro QR code types.

(summarize)
Click to summarize M_ISO_GRADING

Specifies to use an ISO/IEC 15416 or ISO/IEC 15415 specification.

Click to summarize M_SEMI_T10_GRADING

Specifies to use a Semi T10 specification.

This control value is available for the Data Matrix code type.

(summarize)
Click to summarize M_INSPECTION_BAND_RATIO

Sets the height of the inspection band as a percentage of the average bar height. The inspection band is the area of the code occurrence from which the scan lines to grade the code occurrence are taken, after it has been located.

This control type is only available for 1D code types and 2D cross-row code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default percentage. The default value is 80% of average bar height.

(summarize)
Click to summarize 0.0 < Value < 100.0

Specifies the percentage of the average bar height to set as the height of the inspection band.

Click to summarize M_MAXIMUM_CALIBRATED_REFLECTANCE

Sets the maximum possible grayscale value in the target image. This control type is used in the scan reflectance profile analysis. If this control type does not accurately represent the actual maximum grayscale value from the target image, the resulting values from the scan reflectance profile are invalid. Note that this value must be higher than the value of M_MINIMUM_CALIBRATED_REFLECTANCE. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 255.

Click to summarize 0 <= Value <= 255

Specifies the maximum calibrated reflectance. Only integer values are accepted.

(summarize)
Click to summarize M_MEAN_LIGHT_CALIBRATION

Sets the expected mean light (MLcal). This corresponds to the expected mean intensity of the centers of the white elements of the code occurrence.

This control type is used during the target grading phase of the ISO/IEC TR 29158 specification.

Note that the value of this control type can also be set using M_DPM_CALIBRATION_RESULTS.

This control type is available for Aztec, Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is equal to the setting of M_MAXIMUM_CALIBRATED_REFLECTANCE.

Click to summarize 0 <= Value <= 255

Specifies the mean intensity. This value is typically derived during the reflectance calibration phase.

(summarize)
Click to summarize M_MINIMUM_CALIBRATED_REFLECTANCE

Sets the minimum possible grayscale value in the target image. This control type is used in the scan reflectance profile analysis. If this control type does not accurately represent the actual minimum grayscale value from the target image, the resulting values from the scan reflectance profile are invalid. Note that this value must be lower than the value of M_MAXIMUM_CALIBRATED_REFLECTANCE. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.

Click to summarize 0 <= Value <= 255

Specifies the minimum calibrated reflectance. Only integer values are accepted.

(summarize)
Click to summarize M_NUMBER_OF_SCANLINES

Sets the number of scan lines inside the inspection band to inspect during the McodeGrade() operation, after the code occurrence has been located. Set the height of the inspection band using M_INSPECTION_BAND_RATIO.

This control type is only available for 1D code types and 2D cross-row code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value. The default value is 10 scan lines.

(summarize)
Click to summarize M_ALL

Specifies to use all possible scan lines inside the inspection band.

Click to summarize Value > 0

Specifies the number of scan lines to inspect. This value is equivalent to M_ALL if it exceeds the inspection band height. Only integer values are accepted.

(summarize)
Click to summarize M_PIXEL_SIZE_IN_MM

Sets the scale between a pixel and its physical measurement in mm. To simplify the computation of this value, measure the length of the entire code and divide it by its pixel length; this yields a good approximation. Alternatively, calculate the scale using the following formula: (size of the object) / (number of pixels in object). For more information, see point 3 in the MIL calculated aperture setting subsection of the Verification process and grading your code section of Chapter 15: Codes.

Code specifications generally specify constraints in mm units. To compare values known in MIL (for example, the cell size in pixels) to the values in the code specifications, this control type is used. Note that this control type can impact other control types, for example, the aperture size selection, and the M_SCAN_INTERCHARACTER_GAP_GRADE result (retrieved using McodeGetResult()).

Note that this value is needed even when operating on calibrated images because MIL does not know the relationship between mm and the world units of the calibrated context. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_UNKNOWN.

Click to summarize M_UNKNOWN

Specifies that the scale between a pixel and its physical measurement is not known, in mm per pixel units.

Click to summarize Value > 0

Specifies the scale between a pixel and its physical measurement, in mm per pixel units.

Click to summarize M_REFLECTANCE_CALIBRATION

Sets the expected reflectance value (Rcal). This control type is used during the target grading phase of the ISO/IEC TR 29158 specification.

Note that the value of this control type can also be set using M_DPM_CALIBRATION_RESULTS.

This control type is available for Aztec, Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is equal to the setting of M_MAXIMUM_CALIBRATED_REFLECTANCE.

Click to summarize 0 <= Value <= 255

Specifies the reflectance value. This value is typically derived during the reflectance calibration phase. Only integer values are accepted.

(summarize)
Click to summarize M_RELATIVE_APERTURE_FACTOR

Sets the aperture factor to use when M_APERTURE_MODE is set to M_RELATIVE. The aperture factor is multiplied by the M_CELL_SIZE_MIN to determine the aperture's diameter. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies that the aperture factor is chosen according to the ISO/IEC 15416 specification for all supported code types except 2D matrix code types; for the latter, the aperture factor is chosen according to the ISO/IEC 15415 or ISO/IEC TR 29158 specification (depends on M_GRADING_STANDARD).

Note that if the nominal bar width is less than 0.1 mm, the aperture factor is 0.5. When dealing with EAN/UPC code types, the aperture factor is 0.15. When dealing with 2D matrix code types, the aperture factor is 0.8.

Note that the recommended aperture size in the ISO/IEC 15415 specification has changed. The 2004 specification states that the aperture size should be 0.8 times the diameter. The 2011 specification recommends an aperture size between 50% and 80% of the smallest X-dimension encountered. M_AUTO complies with the 2004 version of the specification. Since the new specification now permits alternative aperture sizes, using an aperture factor of 0.5 with 2D matrix code types can often lead to better results.

(summarize)
Click to summarize 0 <= Value <= 2

Specifies the aperture factor.

Click to summarize M_SYSTEM_RESPONSE_CALIBRATION

Sets the System Response value derived during the reflectance calibration phase (SRcal) of the ISO/IEC TR 29158 specification.

The System Response value is a user-defined aggregate of the settings of environmental factors, such as exposure time and/or gain factor, that create the conditions for an acceptable image of the code.

For example, you could define the System Response value as: ( Exposure time * Gain factor ). During the reflectance calibration phase, adjust the exposure time and/or gain factor until you obtain an acceptable image of the code, and then multiply the two values together. At the beginning of the target grading phase, set this result as the System Response value of the reflectance calibration phase.

Note that you should use the same formula to calculate the System Response value, in both the reflectance calibration phase and the target grading phase.

This control type is only available for Aztec, Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 1.0.

Click to summarize Value > 0.0

Specifies the System Response value for the reference code.

Click to summarize M_SYSTEM_RESPONSE_TARGET

Sets the System Response value derived during the target grading phase (SRtarget) of the ISO/IEC TR 29158 specification.

To set this control type, use the same aggregate of environmental factors that was used to calculate M_SYSTEM_RESPONSE_CALIBRATION.

For example, if you set the System Response value of the reflectance calibration phase to the multiplication of the exposure time by the gain factor, set the System Response value of the target grading phase to the multiplication of the exposure time by the gain factor used to create the conditions for an acceptable image of the target code. During the target grading phase, you should not alter any environmental factors other than those used to calculate the System Response value.

This control type is only available for Aztec, Data Matrix, QR code, and Micro QR code types. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 1.0.

Click to summarize Value > 0.0

Specifies the System Response value for the target code.

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeTrain() operation. In this case, a code context must be passed to the ContextOrResultCodeId parameter.

function map Code context settings for an McodeTrain() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_RESET_FROM_TRAINED_RESULTS

Resets the code context using the results in the code train result buffer. Existing code models are discarded and code models used for training are added to the context. If a control type was not trained, it is set to its value used during training; if a control type was trained, it is set to its trained value. The results in the code train result buffer can be applied to any code context.

To reconfigure the code context that was used during training, you might find it useful to selectively change some control types to their recommended setting, established during training. To do so, you can use McodeGetResult() to retrieve their recommended setting, and then use McodeControl() to set them explicitly. Note that some control types are inter-dependent. Changing the setting of one control type to its trained value might not be optimal if the settings of other control types are not also changed. This is especially true for control types that are automatically activated for training if another control type is activated (for example, M_CELL_NUMBER_...).

(summarize)
Click to summarize CodeTrainResultBufId

Specifies the identifier of the code train result buffer to use to reset the code context. The result buffer must have been previously allocated using McodeAllocResult() with M_CODE_TRAIN_RESULT and must contain results from a successful McodeTrain(). Use McodeGetResult() with M_STATUS to ensure that the result buffer contains results from a successful operation (M_STATUS_TRAIN_OK).

(summarize)
Click to summarize M_SET_TRAINING_STATE_ALL

Resets whether all trainable control types will be trained when McodeTrain() is called. Using this control type is equivalent to using the M_TRAIN combination value with every trainable control type.

After activating or deactivating all trainable control types using M_SET_TRAINING_STATE_ALL, you can then activate or deactivate the training of specific control types using M_TRAIN, if necessary.

M_SET_TRAINING_STATE_ALL modifies the training status of M_CELL_NUMBER_X, M_CELL_NUMBER_Y, M_CELL_SIZE_MAX, M_CELL_SIZE_MIN, M_CODE_FLIP, M_DATAMATRIX_SHAPE, M_DECODE_ALGORITHM, M_DOT_SPACING_MAX, M_DOT_SPACING_MIN, M_ENCODING, M_ERROR_CORRECTION, M_FOREGROUND_VALUE, M_SEARCH_ANGLE, M_SPEED, M_THRESHOLD_MODE, and M_USE_PRESEARCH.

(summarize)
Click to summarize M_DEFAULT

Specifies the default activation; the default activation depends on the control type and code model type. For a given trainable control type, if an unsupported code model is included in the training, the default value will be M_DISABLE, otherwise it will be M_ENABLE.

(summarize)
Click to summarize M_DISABLE

Specifies to not train any of the trainable control types.

Click to summarize M_ENABLE

Specifies to train all trainable control types.

Click to summarize M_STOP_TRAIN

Stops the current McodeTrain() operation being performed on the code context passed to ContextOrResultCodeId.

This must be called from another thread, typically of higher priority.

After making this call, the results returned to the result buffer of the McodeTrain() operation are invalid and discarded.

(summarize)
Click to summarize M_DEFAULT

Specifies the default behavior.

Click to summarize M_TRAIN_TIMEOUT

Sets the maximum training time for an McodeTrain() operation. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies to disable the timeout.

Click to summarize Value >= 0

Specifies the timeout limit, in msec.

The following ControlType and corresponding ControlValue parameter settings can be specified for a code model to control an McodeRead(), McodeGrade(), or McodeTrain() operation. If you pass a code context to the ContextOrResultCodeId parameter, the specified control type setting is applied to all the code models in the context. If none of the code models support the specified control type, an error will occur. If only some code models do not support the specified control type, the control type setting is ignored for these code models.

Note that besides code type restrictions listed explicitly in the values below, McodeGrade() does not support M_4_STATE, M_PHARMACODE, M_POSTNET, and M_PLANET code types.

Although all these control types affect the results of McodeTrain(), see the description of the control types to determine if they can be activated for training; you can also use filters to limit the control types in the table to those that can be trained.

function map Code model settings for an McodeRead(), McodeGrade(), or McodeTrain() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_BEARER_BAR

Sets whether bearer bars run along the top and bottom of the code occurrences to read (such as, the edge of a sticker). Note that this control type is only taken into account when the search angle is not specified.

This value is available only for 1D code types.

In situations where bearer bars don't run along both the top and the bottom of the code occurrence to read, setting M_SPEED to M_VERY_LOW will provide more robust results. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ABSENT.

Click to summarize M_ABSENT

Specifies that no bearer bars are above and below the code.

Click to summarize M_PRESENT

Specifies that there are bearer bars above and below the code.

Click to summarize M_CELL_NUMBER_X_MAX

Sets the maximum number of cells for which to search, in the X-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for 2D code types.

Note that this control type is automatically activated for training if you activate M_CELL_NUMBER_X for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for code occurrences with any number of cells.

Click to summarize Value > 0

Specifies the maximum number of cells for which to search. If a value is specified, it must be larger than M_CELL_NUMBER_X_MIN, otherwise an error occurs. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_NUMBER_X_MIN

Sets the minimum number of cells for which to search, in the X-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for 2D code types.

Note that this control type is automatically activated for training if you activate M_CELL_NUMBER_X for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for code occurrences with any number of cells.

Click to summarize Value > 0

Specifies the minimum number of cells for which to search. If a value is specified, it must be smaller than M_CELL_NUMBER_X_MAX, otherwise an error occurs. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_NUMBER_Y_MAX

Sets the maximum number of cells for which to search, in the Y-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for 2D code types.

Note that this control type is automatically activated for training if you activate M_CELL_NUMBER_Y for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for code occurrences with any number of cells.

Click to summarize Value > 0

Specifies the maximum number of cells for which to search. If a value is specified, it must be larger than M_CELL_NUMBER_Y_MIN, otherwise an error occurs. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_NUMBER_Y_MIN

Sets the minimum number of cells for which to search, in the Y-direction of a 2D code.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only available for 2D code types.

Note that this control type is automatically activated for training if you activate M_CELL_NUMBER_Y for training. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for code occurrences with any number of cells.

Click to summarize Value > 0

Specifies the minimum number of cells for which to search. If a value is specified, it must be smaller than M_CELL_NUMBER_Y_MAX, otherwise an error occurs. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_SIZE_MAX +

Sets the maximum cell size. Note that setting the maximum and minimum cell size increases both the speed and robustness of the operation.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies to select an appropriate size, automatically.

Click to summarize Value

Specifies the maximum cell size, relative to the input coordinate system specified using M_CELL_SIZE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_CELL_SIZE_MIN +

Sets the minimum cell size. Note that setting the maximum and minimum cell size increases both the speed and robustness of the operation.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default cell size, in pixels. Setting the default ignores the input unit type chosen with M_CELL_SIZE_INPUT_UNITS.

The default depends on the operation and the code type. For an McodeRead() operation, M_DEFAULT is equivalent to 1, except for M_AZTEC, M_DATAMATRIX, M_QRCODE, and M_MICROQRCODE (which have a default of 3).

(summarize)
Click to summarize Value

Specifies the minimum cell size, relative to the input coordinate system specified using M_CELL_SIZE_INPUT_UNITS.

When entering a value in pixel units, this value must be between 1 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_CHECK_FINDER_PATTERN

Sets whether checking for a false Data Matrix pattern is enabled.

If this control type is enabled, McodeRead() and McodeGrade() operations are more robust, and false Data Matrix code types are not read.

This control type should only be enabled if it is possible that parts of your image could be falsely interpreted as a Data Matrix code types.

This control type is only available for the Data Matrix code type. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies that the Code module will not check for false Data Matrix code types.

Click to summarize M_ENABLE

Specifies that the Code module will check for false Data Matrix code types.

Click to summarize M_CHECK_QUIET_ZONE

Sets whether the presence of the quiet zone is necessary for a successful McodeRead() or McodeGrade() operation of this code type.

Note that the specifications of a code's quiet zone are dependent upon the code type. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ENABLE.

Click to summarize M_DISABLE

Specifies that a quiet zone is not necessary. When set to M_DISABLE, the McodeRead() or McodeGrade() operation can be less robust, especially for 1D code types.

(summarize)
Click to summarize M_ENABLE

Specifies that a quiet zone is necessary.

Click to summarize M_CODE_FLIP +

Sets whether code occurrences need to be flipped or read in the opposite direction to be read properly.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is M_ANY.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_NO_FLIP.

(summarize)
Click to summarize M_ANY

Allows MIL to decide whether a code occurrence needs to be flipped or read in the opposite direction to be read properly.

Click to summarize M_FLIP

Specifies that code occurrences need to be flipped or read in the opposite direction to be read properly. When dealing with 1D code types, a code occurrence will be read from left-to-right and from right-to-left. When dealing with 2D code types, a code occurrence will be flipped before being read.

(summarize)
Click to summarize M_NO_FLIP

Specifies that code occurrences don't need to be flipped or read in the opposite direction. When dealing with 1D code types, a code occurrence will be read from left-to-right. When dealing with 2D code types, a code occurrence will not be flipped.

(summarize)
Click to summarize M_CODE_SEARCH_MODE

Sets the behavior of the decoding algorithm.

Note that the default setting is M_FAST in the majority of cases. To avoid obtaining false positives when searching for a specific number of occurrences (M_NUMBER and M_TOTAL_NUMBER), set M_CODE_SEARCH_MODE to M_BEST.

Note that only 1D code types (excluding M_4_STATE, M_GS1_DATABAR, M_PLANET, and M_POSTNET) support the M_BEST control value setting. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

The default value is M_FAST for all code types except M_PHARMACODE, in which case, the default value is M_BEST.

(summarize)
Click to summarize M_BEST

Specifies to search and return the best quality code occurrences.

Click to summarize M_FAST

Specifies to search and return the first code occurrences decoded.

Click to summarize M_DATAMATRIX_SHAPE +

Sets the shape of the Data Matrix code type.

This control type is only available for the Data Matrix code type.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies that the Data Matrix code type can be any shape.

Click to summarize M_RECTANGLE

Specifies that the Data Matrix code has a rectangular shape. This shape can only use the M_ECC_200 error correction scheme.

(summarize)
Click to summarize M_SQUARE

Specifies that the Data Matrix code has a square shape. The number of cells in X and Y must be equal, and the aspect ratio of cell sizes in the X and Y direction must be near 1:1.

(summarize)
Click to summarize M_DECODE_ALGORITHM +

Sets the decoding algorithm to use to read the code occurrences.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is M_CODE_DEFORMED.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_CODE_NOT_DEFORMED.

(summarize)
Click to summarize M_CODE_DEFORMED

Specifies to use the algorithm to decode deformed code occurrences.

This algorithm is only available for M_AZTEC, M_DATAMATRIX, and M_QRCODE code types.

Note that selecting this algorithm might lead to longer processing times.

(summarize)
Click to summarize M_CODE_NOT_DEFORMED

Specifies to use the algorithm to decode non-deformed code occurrences.

Click to summarize M_DOT_SPACING_INPUT_UNITS

Sets the units with which to interpret the M_DOT_SPACING_MIN and M_DOT_SPACING_MAX control types. This essentially sets the input coordinate system to use.

This control type is only available for M_AZTEC, M_DATAMATRIX, M_MAXICODE, M_QRCODE, and M_MICROQRCODE code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Click to summarize M_DOT_SPACING_MAX +

Sets the maximum distance between 2 dots in a matrix code type composed of dots. Note that the value entered represents half the distance between two dark cells (dots). To set the minimum distance between 2 dots, use M_DOT_SPACING_MIN.

When the dark cells in a printed code are oversized (for example, due to printing artifacts) and overlap, set M_DOT_SPACING_MAX to a negative value equal to half the width of the overlap. The image below illustrates dark cells overlapping, the gray circle represents the actual cell size, while the black dot represents the expected cell size.

By contrast, when the dots are too far apart, specify a positive dot spacing equal to half the distance between the two dots.

This control type is only available for M_AZTEC, M_DATAMATRIX, M_MAXICODE, M_QRCODE, and M_MICROQRCODE code types.

Note that overestimating this value will severely impair reading results.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is 2.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is the same as M_DOT_SPACING_MIN. Note that if M_DOT_SPACING_MIN is also set to M_DEFAULT, the result is no spacing.

(summarize)
Click to summarize -256 <= Value <= 256

Specifies the distance, relative to the input coordinate system specified using M_DOT_SPACING_INPUT_UNITS. Specifying a positive value means that you are specifying half the distance between the edges of the dots. Specifying a negative value means you are specifying the half-depth of the overlap.

If M_DOT_SPACING_INPUT_UNITS is set to M_WORLD, the distance is specified in world units. MIL transforms the value to pixel units according to the camera calibration of the target image that is specified when reading the code occurrence.

Whether to use a negative or positive dot spacing is a situation best determined by testing. For more information, refer to the Dot spacing subsection of the Customizing read and grade operation settings section of Chapter 15: Codes.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_DOT_SPACING_MIN +

Sets the minimum distance between 2 dots in a matrix code type composed of dots. Note that the value entered represents half the distance between two dark cells (dots). For more information, refer to M_DOT_SPACING_MAX.

This control type is only available for M_AZTEC, M_DATAMATRIX, M_MAXICODE, M_QRCODE, and M_MICROQRCODE code types.

Note that overestimating this value will severely impair reading results.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is the same as -1.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is the same as M_DOT_SPACING_MAX. Note that if M_DOT_SPACING_MAX is also set to M_DEFAULT, the result is no spacing.

(summarize)
Click to summarize -256 <= Value <= 256

Specifies the distance, relative to the input coordinate system specified using M_DOT_SPACING_INPUT_UNITS. Specifying a positive value means that you are specifying half the distance between the edges of the dots. Specifying a negative value means you are specifying the half-depth of the overlap.

If M_DOT_SPACING_INPUT_UNITS is set to M_WORLD, the distance is specified in world units. MIL transforms the value to pixel units according to the camera calibration of the target image that is specified when reading the code occurrence.

Whether to use a negative or positive dot spacing is a situation best determined by testing. For more information, refer to the Dot spacing subsection of the Customizing read and grade operation settings section of Chapter 15: Codes.

When entering a value in pixel units, this value must be between -256 and 256, inclusive.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_ECC_CORRECTED_NUMBER

Sets whether McodeRead() or McodeGrade() are forced to perform a more robust operation to minimize the number of errors to correct.

Enabling M_ECC_CORRECTED_NUMBER decreases performance, particularly in good quality images or in images where the error count is not important.

This control type is only available for PDF417 and Truncated PDF417 code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies not to perform a more robust operation.

Click to summarize M_ENABLE

Specifies to perform a more robust operation.

Click to summarize M_FINDER_PATTERN_EXHAUSTIVE_SEARCH

Sets whether to search for the L-shaped finder pattern (the gray boxed area in the following image) to help localize the Data Matrix code. Note that enabling this control type increases the operation time, but is more reliable when a Data Matrix code has little contrast between foreground and background colors or when dealing with complex images.

This control type is only available when M_DECODE_ALGORITHM is set to M_CODE_DEFORMED or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

In addition, this control type is only available for Data Matrix code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies to not perform an exhaustive search.

Click to summarize M_ENABLE

Specifies to perform an exhaustive search.

Click to summarize M_FINDER_PATTERN_INPUT_UNITS

Sets the units with which to interpret the M_FINDER_PATTERN_MAX_GAP and M_FINDER_PATTERN_MINIMUM_LENGTH control types. This essentially sets the input coordinate system to use.

This control type is only available when M_DECODE_ALGORITHM is set to M_CODE_DEFORMED or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

In addition, this control type is only available for Data Matrix code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

(summarize)
Click to summarize M_FINDER_PATTERN_MAX_GAP

Sets the maximum tolerable gap in the finder pattern of a Data Matrix code. A gap is an unintentional space (area of background color), in the solid foreground color area of a Data Matrix code's finder pattern. A code occurrence that has a finder pattern with a gap larger than the specified value is not read.

This control type is only available when M_DECODE_ALGORITHM is set to M_CODE_DEFORMED or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

In addition, this control type is only available for Data Matrix code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies that the maximum tolerable gap in the finder pattern is 6 times the minimum cell size specified using M_CELL_SIZE_MIN.

Click to summarize Value

Specifies the maximum gap allowed, in input units specified using M_FINDER_PATTERN_INPUT_UNITS.

Click to summarize M_FINDER_PATTERN_MINIMUM_LENGTH

Sets the shortest acceptable length of either "arm" of the finder pattern of a Data Matrix code occurrence. If either "arm" is shorter than the minimum, the code occurrence is not read.

This control type is only available when M_DECODE_ALGORITHM is set to M_CODE_DEFORMED or when M_USE_PRESEARCH is set to M_FINDER_PATTERN_BASE.

In addition, this control type is only available for Data Matrix code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies that the minimum acceptable finder pattern "arm" length is 6 times the minimum cell size specified using M_CELL_SIZE_MIN.

Click to summarize Value

The minimum acceptable finder pattern "arm" length, in input units specified using M_FINDER_PATTERN_INPUT_UNITS.

Click to summarize M_NUMBER

Sets the maximum number of code occurrences of the specified code model to read or grade.

Note that this number is limited by the specified maximum total number of code occurrences in the image to read or grade (McodeControl() with M_TOTAL_NUMBER).

To avoid obtaining false positives when searching for a specific number of occurrences, set M_CODE_SEARCH_MODE to M_BEST. Note that M_BEST is not supported for 2D code types.

Only 1D code types (excluding GS1 Databar, 4-state, Planet, and Postnet code types) and the 2D Data Matrix code type support searching for multiple occurrences. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 1.

Click to summarize M_ALL

Specifies that all code model occurrences are read/graded up to the maximum number limited by M_TOTAL_NUMBER.

Click to summarize Value >= 0

Specifies the maximum number of code occurrences of the specified code model to read or grade. Only integer values are accepted.

(summarize)
Click to summarize M_POSITION_ACCURACY

Sets the accuracy of positional results. Accuracy depends on the settings of the code context and its models.

It is always recommended to set this control type to M_HIGH when performing an McodeGrade() operation; for higher accuracy, this is also recommended when performing an McodeRead() on multiple code occurrences. Note that this can result in longer read times. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is M_HIGH.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_LOW.

(summarize)
Click to summarize M_HIGH

Specifies to report the positional results of the code operation with high accuracy.

Click to summarize M_LOW

Specifies to report the positional results of the code operation with low accuracy.

Click to summarize M_SEARCH_ANGLE +

Sets the nominal search angle.

The search is performed between the range of angles defined by: (M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG) to (M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS), inclusively, starting with an angle closest to that of M_SEARCH_ANGLE.

For the M_AZTEC, M_DATAMATRIX, M_QRCODE, M_MICROQRCODE, M_MAXICODE, M_PDF417, and M_TRUNCATED_PDF417 code types, the angular range does not affect the speed of the operation.

Note that M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS must be set to M_DEFAULT when dealing with the following code types: M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417. Their default angular search range will be used.

When the search speed M_SPEED is set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value; the default value is 0.0 degrees.

Click to summarize M_ACCORDING_TO_REGION

Specifies that the nominal angle is set to the angle of the target image's ROI (MbufSetRegion()); recall that for McodeGrade() and McodeRead(), the ROI must be rectangular. If this value is chosen but no ROI has been defined, the angle is set to 0.0°.

(summarize)
Click to summarize 0.0 <= Value <= 360.0

Specifies the nominal angle, in degrees, relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS.

An angle interpreted with respect to the pixel coordinate system is always measured counter-clockwise. For information on the angle's direction of rotation when interpreting the angle with respect to the relative coordinate system, see the Angle convention in MIL subsection of the Working with real-world units section of Chapter 26: Calibrating your camera setup.

(summarize)
Click to summarize M_SEARCH_ANGLE_DELTA_NEG

Sets the negative angular range of the search.

When M_SEARCH_ANGLE_MODE is enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. When M_SEARCH_ANGLE_MODE is disabled, this setting has no effect.

For the M_AZTEC, M_DATAMATRIX, M_QRCODE, M_MICROQRCODE, M_MAXICODE, M_PDF417, and M_TRUNCATED_PDF417 code types, the angular range does not affect the speed of the operation.

Note that M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS must be set to M_DEFAULT when dealing with the following code types: M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417. Their default angular search range will be used:

Code type

Maximum search angle

M_PHARMACODE

±5°

M_COMPOSITECODE

±5°

M_MICROPDF417

±5°

When the search speed M_SPEED is set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction.

Note that this control type is automatically activated for training if you activate M_SEARCH_ANGLE for training. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is 180.0°. Note that if your code type is M_PHARMACODE, M_COMPOSITECODE, or M_MICROPDF417, the default value is 5.0°.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is 5.0°.

(summarize)
Click to summarize 0.0 <= Value <= 180.0

Specifies a negative angular range, in degrees, relative to the nominal angle set by M_SEARCH_ANGLE. Note that while the nominal angle is relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS, M_SEARCH_ANGLE_DELTA_NEG is not affected by the coordinate system used.

For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

(summarize)
Click to summarize M_SEARCH_ANGLE_DELTA_POS

Sets the positive angular range of the search.

When M_SEARCH_ANGLE_MODE is enabled, codes are sought at the angular range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG to M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS. When M_SEARCH_ANGLE_MODE is disabled, this setting has no effect.

For the M_AZTEC, M_DATAMATRIX, M_QRCODE, M_MICROQRCODE, M_MAXICODE, M_PDF417, and M_TRUNCATED_PDF417 code types, the angular range does not affect the speed of the operation.

Note that M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS must be set to M_DEFAULT when dealing with the following code types: M_PHARMACODE, M_COMPOSITECODE, and M_MICROPDF417. Their default angular search range will be used:

Code type

Maximum search angle

M_PHARMACODE

±5°

M_COMPOSITECODE

±5°

M_MICROPDF417

±5°

When the search speed M_SPEED is set to M_VERY_LOW, a more exhaustive search algorithm is enabled that can exceed the specified angle range. In this case, the specified angle range is used as a starting reference for the search instead of as a search restriction.

Note that this control type is automatically activated for training if you activate M_SEARCH_ANGLE for training. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is 180.0°. Note that if your code type is M_PHARMACODE, M_COMPOSITECODE, or M_MICROPDF417, the default value is 5.0°.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is 5.0°.

(summarize)
Click to summarize 0.0 <= Value <= 180.0

Specifies a positive angular range, in degrees, relative to the nominal angle set by M_SEARCH_ANGLE. Note that while the nominal angle is relative to the input coordinate system specified using M_SEARCH_ANGLE_INPUT_UNITS, M_SEARCH_ANGLE_DELTA_POS is not affected by the coordinate system used.

For 1D codes, the Code module will not use the search angular range algorithm if M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE_DELTA_POS both have a value of less than 5°, regardless of M_SEARCH_ANGLE_MODE.

(summarize)
Click to summarize M_SEARCH_ANGLE_INPUT_UNITS

Sets the units with which to interpret the M_SEARCH_ANGLE control type. This essentially sets the input coordinate system to use. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the value in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the value in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead() or McodeGrade() generates an error if the operation is not performed on a calibrated image.

If there is distortion in the target image, you should correct the image before performing an McodeRead() or McodeGrade() operation.

(summarize)
Click to summarize M_SEARCH_ANGLE_STEP

Sets the angle increment/decrement used when searching for a 1D code through an angular range.

When M_SEARCH_ANGLE_STEP is enabled, the search angular range algorithm will first search at the specified nominal angle. It will then toggle between incrementing and decrementing from the nominal angle, with each iteration moving further away from the initial search angle by the value of M_SEARCH_ANGLE_STEP. The process will continue either until the code is found, or the search falls outside of the range defined by M_SEARCH_ANGLE - M_SEARCH_ANGLE_DELTA_NEG and M_SEARCH_ANGLE + M_SEARCH_ANGLE_DELTA_POS.

Note that this control type is ignored if M_SPEED is set to M_VERY_LOW, or M_SEARCH_ANGLE_MODE is set to M_DISABLE.

This inquire type is only available for 1D code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_DISABLE.

Click to summarize M_DISABLE

Specifies that no explicit increment/decrement is used. The actual increment/decrement used during the search is determined by the search angular range algorithm.

(summarize)
Click to summarize 0.1 <= Value <= 180.0

Specifies the explicit angle increment/decrement, in degrees.

Click to summarize M_STRING_SIZE_MAX

Sets the maximum size (number of characters) of the string encoded in a code occurrence. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies that there is no maximum string size.

Click to summarize 0 <= Value <= 65535

Specifies the maximum string size.

For a 1D code (except M_POSTNET, M_PLANET and M_CODABAR codes), the range of possible values starts at 1.

For a M_POSTNET code, the value must be either 5, 9, or 11.

For a M_PLANET code, the value must be 11 or 13.

For a M_CODABAR code, the value must be at least 3.

For all 2D codes and cross-row codes (except M_AZTEC with M_ENCODING set to M_ENC_AZTEC_RUNE and M_MAXICODE with M_ENCODING set to either M_ENC_MODE2 or M_ENC_MODE3) the value can start at 0.

Only integer values are accepted.

(summarize)
Click to summarize M_STRING_SIZE_MIN

Sets the minimum size (number of characters) of the string encoded in a code occurrence. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies that there is no minimum string size.

Click to summarize 0 <= Value <= 65535

Specifies the minimum string size.

For a 1D code (except M_POSTNET, M_PLANET and M_CODABAR codes), the range of possible values starts at 1.

For a M_POSTNET code, the value must be either 5, 9, or 11.

For a M_PLANET code, the value must be 11 or 13.

For a M_CODABAR code, the value must be at least 3.

For all 2D codes and cross-row codes (except M_AZTEC with M_ENCODING set to M_ENC_AZTEC_RUNE and M_MAXICODE with M_ENCODING set to either M_ENC_MODE2 or M_ENC_MODE3) the value can start at 0.

Only integer values are accepted.

(summarize)
Click to summarize M_SUB_TYPE

Sets the particular code sub-types for which to search. Enabling fewer sub-types will help increase the speed of the operation.

Some versions of GS1 Databar codes only differ by their bar height and not their structure. In these cases, the operation is successful even if only one of the sub-types is enabled. For example, GS1 Databar Omnidirectional and GS1 Databar Truncated can be decoded if either M_GS1_DATABAR_OMNI or M_GS1_DATABAR_TRUNCATED is enabled.

The sub-types are additive. If you set the sub-type to M_UPC_A + M_GS1_DATABAR_OMNI, you can search for UPC A and GS1 Databar codes. If you enabled other sub-types previously, they are no longer enabled.

This value is available only for M_GS1_DATABAR and M_COMPOSITECODE code types. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for all of the code sub-types that can be specified for M_SUB_TYPE.

Click to summarize M_EAN8

Specifies that the EAN 8 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Click to summarize M_EAN13

Specifies that the EAN 13 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Click to summarize M_GS1_128

Specifies that the GS1-128 code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Click to summarize M_GS1_DATABAR_EXPANDED

Specifies that the GS1 Databar Expanded code sub-type is enabled.

Click to summarize M_GS1_DATABAR_EXPANDED_STACKED

Specifies that the GS1 Databar Expanded Stacked code sub-type is enabled.

Click to summarize M_GS1_DATABAR_LIMITED

Specifies that the GS1 Databar Limited code sub-type is enabled.

Click to summarize M_GS1_DATABAR_OMNI

Specifies that the GS1 Databar Omnidirectional code sub-type is enabled.

Click to summarize M_GS1_DATABAR_STACKED

Specifies that the GS1 Databar Stacked code sub-type is enabled.

Click to summarize M_GS1_DATABAR_STACKED_OMNI

Specifies that the GS1 Databar Stacked Omnidirectional code sub-type is enabled.

Click to summarize M_GS1_DATABAR_TRUNCATED

Specifies that the GS1 Databar Truncated code sub-type is enabled.

Click to summarize M_UPC_A

Specifies that the UPC-A code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Click to summarize M_UPC_E

Specifies that the UPC-E code sub-type is enabled.

M_COMPOSITECODE is the only code type that supports this setting.

(summarize)
Click to summarize M_USE_PRESEARCH +

Sets whether the localization operation is performed prior to the decoding step of an operation.

Note that, when reading multiple occurrences of Data Matrix codes, the setting of this control type is ignored.

This control type is only available for 2D code types.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION and the code type is M_DATAMATRIX, the default value is M_FINDER_PATTERN_BASE. For 2D code types other than M_DATAMATRIX, the default value is M_STAT_BASE.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_DISABLE.

(summarize)
Click to summarize M_DISABLE

Specifies that the operation is not performed.

Click to summarize M_FINDER_PATTERN_BASE

Specifies that the localization operation is only performed on the base pattern of the Data Matrix code (an "L" starting at the top-most left corner, and ending on the bottom-most right corner of the code). This localization operation is more robust than an M_STAT_BASE localization operation. Note that if the surrounding image is very complex, better results might be obtained by setting M_FINDER_PATTERN_EXHAUSTIVE_SEARCH to M_ENABLE.

M_DATAMATRIX is the only code type that supports this setting.

(summarize)
Click to summarize M_STAT_BASE

Specifies to localize the code within the image with the statistical characteristics of a 2D bar code (for example, local variance and the presence of a lot of edges). This localization operation is performed faster than an M_FINDER_PATTERN_BASE localization operation.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified for a code model to control an McodeRead(), McodeGrade(), McodeTrain(), or McodeWrite() operation. If you pass a code context to the ContextOrResultCodeId parameter, the specified control type setting is applied to all the code models in the context. If none of the code models support the specified control type, an error occurs. If only some code models do not support the specified control type, the control type setting is ignored for these code models.

Note that besides code type restrictions listed explicitly in the values below, McodeGrade() does not support M_4_STATE, M_PHARMACODE, M_POSTNET, and M_PLANET code types.

Although all these control types affect the results of McodeTrain(), see the description of the control types to determine if they can be activated for training; you can also use filters to limit the control types in the table to those that can be trained.

function map Code model settings for an McodeRead(), McodeGrade(), McodeTrain(), or McodeWrite() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_CELL_NUMBER_X +

Sets the number of cells of a 2D code in the X-direction. Note that setting the number of cells in both the X- and Y-direction, increases the robustness of the operation.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only used for 2D code types. The number of cells is not required for Maxicode because it is a fixed size.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for a code with any number of cells, when performing an McodeRead() or McodeGrade() operation.

Fits the string to be encoded into the smallest possible number of cells, when performing an McodeWrite() operation.

(summarize)
Click to summarize Value > 0

Specifies the number of cells. This can be any integer value. Note that for the PDF417 code type, the value that you pass must be equal to 17c + 35, where c is the required number of columns, and 35 represents the number of cells required for the start and stop characters.

For the Truncated PDF417 code type, the value that you pass must be equal to 17c + 18, where c is the required number of columns, and 18 represents the number of cells required for the start and stop characters.

For the MicroPDF417 code type, this setting should be set to 38 for a one-column code, 55 for a two-column code, 82 for a three-column code, and 99 for a four-column code. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_NUMBER_Y +

Sets the number of cells of a 2D code in the Y-direction. Note that setting the number of cells in both the X- and Y-direction, increases the robustness of the operation.

Note that McodeControl() generates an error if you set both a range of cells for which to search (using M_CELL_NUMBER_X_MAX, M_CELL_NUMBER_X_MIN, M_CELL_NUMBER_Y_MAX, and/or M_CELL_NUMBER_Y_MIN) and an explicit number of cells for which to search (using M_CELL_NUMBER_X and/or M_CELL_NUMBER_Y).

This control type is only used for 2D code types. The number of cells is not required for M_MAXICODE because it is a fixed size. When used with M_PDF417, M_TRUNCATED_PDF417, and M_MICROPDF417, this represents the number of rows.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ANY.

Click to summarize M_ANY

Specifies to search for a code with any number of cells, when performing an McodeRead() or McodeGrade() operation.

Fits the string to be encoded into the smallest possible number of cells, when performing an McodeWrite() operation.

(summarize)
Click to summarize Value > 0

Specifies the number of cells. For exact values, refer to the standard documentation of the code used.

For the PDF417 and Truncated PDF417 code types, M_CELL_NUMBER_Y should have a value between 3 and 90. The value of M_CELL_NUMBER_Y is used when calculating the value of M_CELL_NUMBER_X. Only integer values are accepted.

For the MicroPDF417 code type, M_CELL_NUMBER_Y should have a value between 4 and 44. Only integer values are accepted.

(summarize)
Click to summarize M_CELL_SIZE_INPUT_UNITS

Sets the units with which to interpret the M_CELL_SIZE_MAX and M_CELL_SIZE_MIN control types. This essentially sets the input coordinate system to use. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_PIXEL.

Click to summarize M_PIXEL

Specifies to interpret the values in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies to interpret the values in world units, with respect to the relative coordinate system. If world units are specified, calling McodeRead(), McodeGrade(), McodeTrain(), or McodeWrite() generates an error if the operation is not performed on a calibrated image.

(summarize)
Click to summarize M_ENCODING +

Sets the type of encoding scheme.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies to use the default encoding scheme for the code type. The default value is dependent on the code type and the value of M_INITIALIZATION_MODE. The following table lists the default encoding scheme:

Code type

M_IMPROVED_RECOGNITION

M_TYPICAL_RECOGNITION

4-state

M_ENC_US_MAIL

M_ENC_US_MAIL

Aztec

M_ANY

M_ANY

BC412

M_ENC_STANDARD

M_ENC_STANDARD

Codabar

M_ENC_STANDARD

M_ENC_STANDARD

Code 39

M_ENC_STANDARD

M_ENC_STANDARD

Code 93

M_ENC_ASCII

M_ENC_ASCII

Code 128

M_ENC_ASCII

M_ENC_ASCII

Composite

M_ENC_GS1_DATABAR_OMNI

M_ENC_GS1_DATABAR_OMNI

Data Matrix

M_ANY

M_ANY

EAN 8

M_ANY

M_ENC_NUM

EAN 13

M_ANY

M_ENC_NUM

EAN 14

M_ENC_ASCII

M_ENC_ASCII

GS1-128

M_ENC_ASCII

M_ENC_ASCII

GS1 Databar

M_ENC_GS1_DATABAR_OMNI

M_ENC_GS1_DATABAR_OMNI

Industrial 2 of 5

M_ENC_NUM

M_ENC_NUM

Interleaved 2 of 5

M_ENC_NUM

M_ENC_NUM

Maxicode

M_ANY

M_ANY

MicroPDF417

M_ENC_STANDARD

M_ENC_STANDARD

Micro QR

M_ENC_STANDARD

M_ENC_STANDARD

PDF417

M_ENC_STANDARD

M_ENC_STANDARD

Pharmacode

M_ENC_NUM

M_ENC_NUM

Planet

M_ENC_NUM

M_ENC_NUM

Postnet

M_ENC_NUM

M_ENC_NUM

QR

M_ANY

M_ANY

Truncated PDF

M_ENC_STANDARD

M_ENC_STANDARD

UPC-A

M_ANY

M_ENC_NUM

UPC-E

M_ANY

M_ENC_NUM

(summarize)
Click to summarize M_ANY

Specifies any type of encoding scheme.

M_AZTEC and M_QRCODE are the code types that can use this encoding scheme for McodeWrite() operations.

M_EAN8, M_EAN13, M_UPC_A, M_UPC_E, M_AZTEC, M_DATAMATRIX, M_MAXICODE, and M_QRCODE are the code types that can use this encoding scheme for McodeRead() and McodeGrade() operations.

(summarize)
Click to summarize M_ENC_ALPHA

Specifies an encoding scheme that supports uppercase alphabetical characters, along with the space.

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_ALPHANUM

Specifies an encoding scheme that supports alphanumeric characters, as well as the space.

M_DATAMATRIX is the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_ALPHANUM_PUNC

Specifies a similar encoding scheme to M_ENC_ALPHANUM, except it also supports the following characters: (,), (-), (/) and (.).

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_ASCII

Specifies an encoding scheme that supports ASCII characters.

M_CODE39, M_CODE93, M_CODE128, M_EAN14, and M_DATAMATRIX are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AUSTRALIA_MAIL_C

Specifies an encoding scheme for a 4-state format used with the C encoding table by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AUSTRALIA_MAIL_N

Specifies an encoding scheme for a 4-state format used with the N encoding table by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AUSTRALIA_MAIL_RAW

Specifies an encoding scheme for a 4-state format used by the Australian Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AZTEC_COMPACT

Specifies an encoding scheme for a compact Aztec code.

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AZTEC_FULL_RANGE

Specifies an encoding scheme for a full-range (not compact) Aztec code.

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_AZTEC_RUNE

Specifies an encoding scheme for an Aztec rune (the smallest version of an Aztec code).

M_AZTEC is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_EAN8

Specifies an encoding scheme for a composite code whose 1D portion uses an EAN 8 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_EAN8_ADDON

Specifies an encoding scheme for an EAN 8 format with a supplemental 2 or 5 digit add-on.

When a code occurrence is read, the character "|" is used as a separator between the string read from the EAN 8 code and the string read from the EAN 8 add-on.

M_EAN8 is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_EAN13

Specifies an encoding scheme for a composite code whose 1D portion uses an EAN 13 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_EAN13_ADDON

Specifies an encoding scheme for an EAN 13 format with a supplemental 2 or 5 digit add-on.

When a code occurrence is read, the character "|" is used as a separator between the string read from the EAN 13 code and the string read from the EAN 13 add-on.

M_EAN13 is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_128_MICROPDF417

Specifies an encoding scheme for a composite code whose 1D portion uses a GS1 128 format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_128_PDF417

Specifies an encoding scheme for a composite code whose 1D portion uses a GS1 128 format and whose 2D portion uses a PDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_EXPANDED

Specifies an encoding scheme that uses a GS1 Databar format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Expanded format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_EXPANDED_STACKED

Specifies an encoding scheme that uses a GS1 Databar Expanded Stacked format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Expanded Stacked format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_LIMITED

Specifies an encoding scheme that uses a GS1 Databar Limited format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Limited format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_OMNI

Specifies an encoding scheme that uses a GS1 Databar format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_STACKED

Specifies an encoding scheme that uses a GS1 Databar Stacked format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Stacked format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_STACKED_OMNI

Specifies an encoding scheme that uses a GS1 Databar Stacked Omnidirectional format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Stacked Omnidirectional format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_GS1_DATABAR_TRUNCATED

Specifies an encoding scheme that uses a GS1 Databar Truncated format.

For a composite code, this encoding scheme specifies that the 1D portion uses a GS1 Databar Truncated format and the 2D portion uses a MicroPDF417 format.

M_GS1_DATABAR and M_COMPOSITECODE are the code types that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_ISO8

Specifies a similar encoding scheme as M_ENC_ASCII, but supports the extended ASCII character set.

M_DATAMATRIX is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_KOREA_MAIL

Specifies an encoding scheme for a 4-state format used by the Korean Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_MODE2

Specifies an encoding scheme that requires a Structured Carrier Message. This encoding scheme can be used for a numeric postal code.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_MODE3

Specifies an encoding scheme that requires a Structured Carrier Message. This encoding scheme can be used for an alphanumeric postal code.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_MODE4

Specifies an encoding scheme that requires a Free Format Message.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_MODE5

Specifies an encoding scheme that requires a Free Format Message. This data type has a higher level of error correction than M_ENC_MODE4.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_MODE6

Specifies an encoding scheme that requires a Free Format Message. This encoding scheme indicates that the resulting code is used to program a code reader.

M_MAXICODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_NUM

Specifies an encoding scheme that only supports numbers.

M_EAN8, M_EAN13, M_INDUSTRIAL25, M_INTERLEAVED25, M_PHARMACODE, M_PLANET, M_POSTNET, M_UPC_A, M_UPC_E, and M_DATAMATRIX are the code types that can use this encoding scheme. If the code type is M_DATAMATRIX, spaces are also allowed.

(summarize)
Click to summarize M_ENC_QRCODE_MODEL1

Specifies an encoding scheme that uses an older version of the QR code format.

M_QRCODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_QRCODE_MODEL2

Specifies an encoding scheme that uses a newer version of the QR code format. This version can handle more data and is more robust than model 1.

M_QRCODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_STANDARD

Specifies different types of encoding schemes, depending on what code type is used.

If M_CODE39 or M_CODE93 is the code type, M_ENC_STANDARD supports the alphabet (capital letters), digits 0 - 9, and the (-), space, ($), (/), (+), (.), (%) characters.

If M_BC412 is the code type, M_ENC_STANDARD supports numbers and the alphabet (capital letters), except for the letter O.

If M_PDF417, M_TRUNCATED_PDF417, or M_MICROPDF417 is the code type, M_ENC_STANDARD supports ASCII and extended ASCII characters.

If M_CODABAR is the code type, M_ENC_STANDARD supports digits 0 - 9, the (-), ($), (:), (/), (.), and (+) characters, and the a, b, c, and d characters. It uses the latter four characters as start and stop characters.

(summarize)
Click to summarize M_ENC_UK_MAIL

Specifies an encoding scheme for a 4-state format used by the UK Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_UPCA

Specifies an encoding scheme for a composite code whose 1D portion uses an UPC-A format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_UPCA_ADDON

Specifies an encoding scheme for an UPC-A format with a supplemental 2 or 5 digit add-on.

When a code occurrence is read, the character "|" is used as a separator between the string read from the UPC-A code and the string read from the UPC-A add-on.

M_UPC_A is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_UPCE

Specifies an encoding scheme for a composite code whose 1D portion uses an UPC-E format and whose 2D portion uses a MicroPDF417 format.

M_COMPOSITECODE is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_UPCE_ADDON

Specifies an encoding scheme for an UPC-E format with a supplemental 2 or 5 digit add-on.

When a code occurrence is read, the character "|" is used as a separator between the string read from the UPC-E code and the string read from the UPC-E add-on.

M_UPC_E is the code type that can use this encoding scheme.

(summarize)
Click to summarize M_ENC_US_MAIL

Specifies an encoding scheme for a 4-state format used by the US Mail service.

M_4_STATE is the code type that can use this encoding scheme.

(summarize)
Click to summarize 5 <= Value <= 95

Specifies the minimum amount of the symbol that contains error correction information, as a percentage.

M_4_STATE is the code type that can use this encoding scheme. Only integer values are accepted.

(summarize)
Click to summarize M_ERROR_CORRECTION +

Sets the type of error correction.

Note that if the size of a M_MICROQRCODE code is the smallest possible size, 11x11 (M1 version), M_ERROR_CORRECTION must be set to either M_ANY or M_DEFAULT when performing McodeRead() or McodeGrade() operations.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies to use the default error correction scheme for the code type. The following table lists the default error correction scheme:

4-state

M_ECC_4STATE

Aztec

M_ANY

BC412

M_ECC_NONE

Codabar

M_ECC_NONE

Code39

M_ECC_NONE

Code93

M_ECC_CHECK_DIGIT

Code128

M_ECC_CHECK_DIGIT

Composite

M_ECC_COMPOSITE

Data Matrix

M_ANY

Ean8

M_ECC_CHECK_DIGIT

Ean13

M_ECC_CHECK_DIGIT

GS1 Databar

M_ECC_CHECK_DIGIT

Industrial 2 of 5

M_ECC_NONE

Interleaved 2 of 5

M_ECC_NONE

Maxicode

M_ECC_REED_SOLOMON

MicroPDF417

M_ECC_REED_SOLOMON

Micro QR

M_ANY

PDF417

M_ANY

Pharmacode

M_ECC_NONE

Planet

M_ECC_CHECK_DIGIT

Postnet

M_ECC_CHECK_DIGIT

QR

M_ANY

Truncated PDF417

M_ANY

UPC-A

M_ECC_CHECK_DIGIT

UPC-E

M_ECC_CHECK_DIGIT

(summarize)
Click to summarize M_ANY

Specifies that the error correction type for McodeRead() and McodeGrade() operations is detected automatically. This error correction scheme is only supported for write operations (McodeWrite()) when dealing with M_AZTEC, M_QRCODE, M_MICROQRCODE, M_PDF417, or M_TRUNCATED_PDF417.

When dealing with M_AZTEC, this value specifies that error correction will make up 23% of the symbol.

M_AZTEC, M_DATAMATRIX, M_QRCODE, M_MICROQRCODE, M_PDF417, and M_TRUNCATED_PDF417 are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_4STATE

Specifies to use the Reed-Solomon-based algorithm or a check digit type of error correction scheme, depending on the specification of the encoding.

M_4_STATE is the code type that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_200

Specifies to use a Reed-Solomon-based algorithm as an error correction scheme.

M_DATAMATRIX is the code type that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_CHECK_DIGIT

Specifies to use an additional digit to check whether there is an error or not. There is error detection but not correction.

M_4_STATE M_BC412, M_EAN8, M_EAN13, M_CODE39, M_CODE93, M_CODE128, M_GS1_DATABAR, M_INDUSTRIAL25, M_INTERLEAVED25, M_POSTNET, M_PLANET, M_UPC_A, and M_UPC_E are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_COMPOSITE

Specifies to use the default error correction scheme for the 1D and 2D portions of the composite code.

M_COMPOSITECODE is the code type that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_H

Specifies to use the highest-level error correction scheme.

M_QRCODE is the code type that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_L

Specifies to use the lowest-level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_M

Specifies to use a medium-low level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_NONE

Specifies no error correction.

M_BC412, M_CODABAR, M_CODE39, M_INDUSTRIAL25, M_INTERLEAVED25, and M_PHARMACODE are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_Q

Specifies to use a medium-high level error correction scheme.

M_QRCODE and M_MICROQRCODE are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_REED_SOLOMON

Specifies to use a Reed-Solomon type of error correction scheme.

M_MAXICODE and M_MICROPDF417 are the code types that can use this error correction scheme.

(summarize)
Click to summarize M_ECC_REED_SOLOMON_n

Specifies to use a Reed-Solomon type of error correction scheme. n is an integer from 0 to 8. The higher the number, the higher the level of error correction.

M_PDF417 and M_TRUNCATED_PDF417 are the code types that can use this error correction scheme.

(summarize)
Click to summarize 5 <= Value <= 95

Specifies the minimum percentage of the symbol that contains error correction information.

M_AZTEC is the only code type that can use this error correction scheme. Only integer values are accepted.

(summarize)
Click to summarize M_FOREGROUND_VALUE +

Sets the foreground color of the code.

Note that this control type can be trained using McodeTrain(); activate it for training with the combination constant M_TRAIN or with M_SET_TRAINING_STATE_ALL. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value.

When using a code context with M_INITIALIZATION_MODE set to M_IMPROVED_RECOGNITION, the default value is M_FOREGROUND_ANY.

When using a code context with M_INITIALIZATION_MODE set to M_TYPICAL_RECOGNITION, the default value is M_FOREGROUND_BLACK.

(summarize)
Click to summarize M_FOREGROUND_ANY

Specifies the foreground color as black or white. Note that using this value will impact the performance of McodeRead() and McodeGrade() operations and should be used only when the foreground can change or cannot be known beforehand. When used for McodeWrite() operations, the default color (M_FOREGROUND_BLACK) is used.

(summarize)
Click to summarize M_FOREGROUND_BLACK

Specifies that the foreground color is black.

Click to summarize M_FOREGROUND_WHITE

Specifies that the foreground color is white.

You can add the following value to the above-mentioned values to set whether the control is to be trained.

function map For training a control type
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_TRAIN

Sets whether to activate or deactivate a specified control type for training. Note that training one control type might automatically train some other related control types that cannot be combined with M_TRAIN. For example, activating M_SEARCH_ANGLE for training, also automatically activates M_SEARCH_ANGLE_MODE, M_SEARCH_ANGLE_DELTA_POS, and M_SEARCH_ANGLE_DELTA_NEG for training.

(summarize)
Click to summarize M_DEFAULT

Specifies the default activation; the default activation depends on the control type and code model type. For a given trainable control type, if an unsupported code model is included in the training, the default value will be M_DISABLE, otherwise it will be M_ENABLE.

(summarize)
Click to summarize M_DISABLE

Disables the training of the specified control type.

Click to summarize M_ENABLE

Enables the training of the specified control type.

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeGrade() operation. In this case, the ContextOrResultCodeId parameter must be set to the identifier a code model.

function map Code model settings for an McodeGrade() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_GRADING_STANDARD_EDITION

Sets the grading standard edition to use when performing an McodeGrade() operation.

Note that the grading standard edition must correspond to the grading standard specified using M_GRADING_STANDARD. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies to use the most recent grading standard edition that is supported.

Currently, for 1D code types supported by McodeGrade(), the default value is the same as M_ISO_15416_2016.

Currently, for 2D and composite code types, the default value is the same as M_ISO_15415_2011_15416_2016.

When M_GRADING_STANDARD is set to M_ISO_DPM_GRADING, the default value is the same as M_ISO_29158_2011.

When M_GRADING_STANDARD is set to M_SEMI_T10_GRADING, the default value is the same as M_SEMI_T10_0701.

(summarize)
Click to summarize M_ISO_15415_2011_15416_2000

Specifies to use the ISO/IEC 15415:2011 and ISO/IEC 15416:2000 specifications.

This control value is available for 2D and composite code types, excluding Maxicode.

(summarize)
Click to summarize M_ISO_15415_2011_15416_2016

Specifies to use the ISO/IEC 15415:2011 and ISO/IEC 15416:2016 specifications.

This control value is available for 2D and composite code types, excluding Maxicode.

(summarize)
Click to summarize M_ISO_15416_2000

Specifies to use the ISO/IEC 15416:2000 specification.

This control value is available for 1D code types.

(summarize)
Click to summarize M_ISO_15416_2016

Specifies to use the ISO/IEC 15416:2016 specification.

This control value is available for 1D code types.

(summarize)
Click to summarize M_ISO_29158_2011

Specifies to use the ISO/IEC 29158:2011 specification.

This control value is available for Aztec, Data Matrix, QR code, and Micro QR code types.

(summarize)
Click to summarize M_SEMI_T10_0701

Specifies to use the Semi T10-0701 specification.

This control value is available for the Data Matrix code type.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeWrite() operation. In this case, the ContextOrResultCodeId parameter must be set to the identifier a code model.

Note that you cannot set ContextOrResultCodeId to the identifier of a code context when using the following control types.

function map Code model settings for an McodeWrite() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_CELL_SIZE_MODE

Sets how to establish the cell size to use when performing an McodeWrite() operation. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO.

Click to summarize M_AUTO

Specifies to use the largest possible cell size such that the code will be resized as to just fit into the target image of the operation.

Click to summarize M_USER_DEFINED

Specifies that the cell size corresponds to the value of M_CELL_SIZE_VALUE.

Click to summarize M_CELL_SIZE_VALUE

Sets the cell size to use when performing an McodeWrite() operation and M_CELL_SIZE_MODE is set to M_USER_DEFINED. If M_CELL_SIZE_INPUT_UNITS is set to M_WORLD, specify the cell size in world units. The specified cell size is transformed to pixel units according to the calibration of the target image used for writing. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value. This value is equivalent to either 10 pixels for a Maxicode code type, or 4 pixels for all other codes types.

(summarize)
Click to summarize Value > 0.0

Specifies the cell size.

Note that if the cell size is specified in pixel units, the minimum value that this control type can take is 1.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)
Click to summarize M_DOT_SHAPE

Sets the shape in which to draw cells when performing an McodeWrite() operation. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_SQUARE.

Click to summarize M_CIRCLE

Specifies that the code will be drawn with circular cells.

Note that this control value is only available for M_AZTEC, M_DATAMATRIX, M_QRCODE, and M_MICROQRCODE code types.

(summarize)
Click to summarize M_SQUARE

Specifies that the code will be drawn with square cells.

Note that this control value is available for all code types.

(summarize)
Click to summarize M_DOT_SIZE

Sets the size of the dot (or square) when performing an McodeWrite() operation. The dot size corresponds to the circle diameter if M_DOT_SHAPE is set to M_CIRCLE or to the length of the square if it is set to M_SQUARE.

If M_CELL_SIZE_INPUT_UNITS is set to M_WORLD, specify the dot size in world units. The specified dot size is transformed to pixel units according to the calibration of the target image used for writing. INQ

(summarize)
Click to summarize M_DEFAULT

Specifies the default value. This control value is equivalent to either 10 pixels for a Maxicode code type, or 4 pixels for all other codes types.

(summarize)
Click to summarize Value > 0.0

Specifies the size of the dot or square.

When entering a value in world units, the number that results from the internal transformation of world units to pixel units must still respect the value's pixel unit constraint. To find the range of allowed values in world units, according to your associated camera calibration, use McalTransformResult().

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeRead(), McodeGrade(), McodeDetect(), McodeTrain(), or McodeWrite() operation.

function map Result buffer settings dealing with an McodeRead(), McodeGrade(), McodeDetect(), McodeTrain(), or McodeWrite() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_RESULT_OUTPUT_UNITS

Sets whether to return results in pixels or world units. This essentially sets the output coordinate system to use. The setting of this control type will only affect functions within this module which return positional results. This control type can be changed at any time to return results in the required output units. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_ACCORDING_TO_CALIBRATION.

Click to summarize M_ACCORDING_TO_CALIBRATION

Specifies that results are returned in world units if the result was calculated on an image associated with a camera calibration context; otherwise, specifies that results are returned in pixel units.

Click to summarize M_PIXEL

Specifies that results are returned in pixel units, with respect to the pixel coordinate system.

Click to summarize M_WORLD

Specifies that results are returned in world units, with respect to the relative coordinate system. If world units are specified, calling McodeGetResult() generates an error if the result was not calculated on a calibrated image.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeRead(), McodeGrade(), McodeTrain(), or McodeWrite() operation.

function map Result buffer settings dealing with an McodeRead(), McodeGrade(), McodeTrain(), or McodeWrite() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_STRING_FORMAT

Sets the format in which to return the string, retrieved using McodeGetResult() with M_STRING. INQ

(summarize)
Click to summarize M_DEFAULT

Same as M_AUTO_FORMAT.

Click to summarize M_AUTO_FORMAT

Specifies that the string is returned in the string format associated with the code type.

Graphical interpretations are assigned depending on corresponding character sets, allowing for the use of character set ECIs.

(summarize)
Click to summarize M_GS1_HUMAN_READABLE

Specifies that the string is returned in a format that is human-readable. Note that this is the default format for both a M_EAN14 and M_GS1_128 code type.

This format is only available when reading the following code types: M_CODE128, M_EAN14, M_GS1_128, M_GS1_DATABAR, M_AZTEC, M_DATAMATRIX, M_QRCODE, and M_COMPOSITECODE.

(summarize)
Click to summarize M_JAPANESE
[This is only applicable to Windows]

Specifies that the string is returned in the Japanese (Windows-932) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Click to summarize M_KOREAN
[This is only applicable to Windows]

Specifies that the string is returned in the Korean (Windows-949) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Click to summarize M_LATIN
[This is only applicable to Windows]

Specifies that the returned string uses Latin (Windows-1252) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Click to summarize M_RAW_DATA

Specifies that the string is returned in a raw data format. This format will have the FNC1 separator at the beginning of the string (represented by the è character) and the group separators (GS) will be included in the string (represented by the ascii=29 character or \x1D) (for example, è01034531200000111708050810ABCD1234\x1D4109501101020917).

This format is only available when reading the following code types: M_CODE128, M_EAN14, M_GS1_128, M_GS1_DATABAR, all 2D code types (except M_MICROQRCODE), and composite code types.

When decoding character set ECIs for M_AZTEC, M_DATAMATRIX, M_MAXICODE, M_MICROPDF417, M_QRCODE, M_PDF417, or M_TRUNCATED_PDF417 code types, encodable ECIs are inserted at the appropriate locations. All back slashes (\) in the string are doubled (\\); while typically unprintable characters, such as Arabic characters, are put in a \xnnnnnn format, where nnnnnn is the hexadecimal value representing the unprintable character.

(summarize)
Click to summarize M_SIMPLIFIED_CHINESE
[This is only applicable to Windows]

Specifies that the returned string uses Simplified Chinese (Windows-936) encoding.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)
Click to summarize M_UPCE_COMPRESSED

Specifies that the returned string is in the UPCE compressed string format. Note that this is only available when reading a M_UPC_E code. Otherwise, an error will occur.

(summarize)
Click to summarize M_UTF8

Specifies that the returned string is in the UTF-8 string format.

This format is only available when reading the following code types: M_AZTEC, M_PDF417, M_MICROPDF417, M_TRUNCATED_PDF417, M_QRCODE, M_MICROQRCODE, and M_DATAMATRIX.

This format is not available with Windows Embedded Compact.

(summarize)

The following ControlType and corresponding ControlValue parameter settings can be specified when dealing with an McodeDetect() operation. In this case, a M_CODE_DETECT_RESULT result buffer must be passed to the ContextOrResultCodeId parameter.

function map Result buffer settings dealing with McodeDetect() operation
Click to summarize
ControlType
Description
ControlValue
Click to summarize M_STOP_DETECT

Stops the current McodeDetect() operation being performed on the code result buffer passed to ContextOrResultCodeId.

This must be called from another thread, typically of higher priority.

After making this call, the results returned to the result buffer of the McodeDetect() operation are invalid and discarded.

(summarize)
Click to summarize M_DEFAULT

Specifies the default behavior.

Type-specific versions of the function when using a C compiler under 64-bit
void McodeControlInt64 (MIL_ID ContextOrResultCodeId, MIL_INT64 ControlType, MIL_INT64 ControlValue)
Parameters

ContextOrResultCodeId

See ContextOrResultCodeId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

void McodeControlDouble (MIL_ID ContextOrResultCodeId, MIL_INT64 ControlType, MIL_DOUBLE ControlValue)
Parameters

ContextOrResultCodeId

See ContextOrResultCodeId of the main function for a description.

ControlType

See ControlType of the main function for a description.

ControlValue

See ControlValue of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib; milcode.lib.
DLL Requires mil.dll; milcode.dll.
INITIALIZATION MODE DEFAULT IMPROVED RECOGNITION TYPICAL RECOGNITION MINIMUM CONTRAST DEFAULT SCANLINE HEIGHT DEFAULT SCANLINE INPUT UNITS DEFAULT PIXEL WORLD SCANLINE STEP DEFAULT SEARCH ANGLE MODE DEFAULT DISABLE ENABLE SPEED DEFAULT HIGH LOW MEDIUM VERY HIGH VERY LOW STOP READ DEFAULT THRESHOLD MODE DEFAULT ADAPTIVE GLOBAL SEGMENTATION GLOBAL WITH LOCAL RESEGMENTATION THRESHOLD VALUE DEFAULT AUTO COMPUTE TIMEOUT DEFAULT DISABLE TOTAL NUMBER DEFAULT ALL ABSOLUTE APERTURE SIZE DEFAULT ABSOLUTE APERTURE SIZE INPUT UNITS DEFAULT PIXEL WORLD APERTURE MODE DEFAULT ABSOLUTE DISABLE RELATIVE DPM CALIBRATION RESULTS EXTENDED AREA REFLECTANCE CHECK DEFAULT DISABLE ENABLE GRADE QUIET ZONE DEFAULT DISABLE ENABLE GRADING STANDARD DEFAULT ISO DPM GRADING ISO GRADING SEMI T10 GRADING INSPECTION BAND RATIO DEFAULT MAXIMUM CALIBRATED REFLECTANCE DEFAULT MEAN LIGHT CALIBRATION DEFAULT MINIMUM CALIBRATED REFLECTANCE DEFAULT NUMBER OF SCANLINES DEFAULT ALL PIXEL SIZE IN MM DEFAULT UNKNOWN REFLECTANCE CALIBRATION DEFAULT RELATIVE APERTURE FACTOR DEFAULT AUTO SYSTEM RESPONSE CALIBRATION DEFAULT SYSTEM RESPONSE TARGET DEFAULT RESET FROM TRAINED RESULTS SET TRAINING STATE ALL DEFAULT DISABLE ENABLE STOP TRAIN DEFAULT TRAIN TIMEOUT DEFAULT DISABLE BEARER BAR DEFAULT ABSENT PRESENT CELL NUMBER X MAX DEFAULT ANY CELL NUMBER X MIN DEFAULT ANY CELL NUMBER Y MAX DEFAULT ANY CELL NUMBER Y MIN DEFAULT ANY CELL SIZE MAX DEFAULT CELL SIZE MIN DEFAULT CHECK FINDER PATTERN DEFAULT DISABLE ENABLE CHECK QUIET ZONE DEFAULT DISABLE ENABLE CODE FLIP DEFAULT ANY FLIP NO FLIP CODE SEARCH MODE DEFAULT BEST FAST DATAMATRIX SHAPE DEFAULT ANY RECTANGLE SQUARE DECODE ALGORITHM DEFAULT CODE DEFORMED CODE NOT DEFORMED DOT SPACING INPUT UNITS DEFAULT PIXEL WORLD DOT SPACING MAX DEFAULT DOT SPACING MIN DEFAULT ECC CORRECTED NUMBER DEFAULT DISABLE ENABLE FINDER PATTERN EXHAUSTIVE SEARCH DEFAULT DISABLE ENABLE FINDER PATTERN INPUT UNITS DEFAULT PIXEL WORLD FINDER PATTERN MAX GAP DEFAULT AUTO FINDER PATTERN MINIMUM LENGTH DEFAULT AUTO NUMBER DEFAULT ALL POSITION ACCURACY DEFAULT HIGH LOW SEARCH ANGLE DEFAULT ACCORDING TO REGION SEARCH ANGLE DELTA NEG DEFAULT SEARCH ANGLE DELTA POS DEFAULT SEARCH ANGLE INPUT UNITS DEFAULT PIXEL WORLD SEARCH ANGLE STEP DEFAULT DISABLE STRING SIZE MAX DEFAULT ANY STRING SIZE MIN DEFAULT ANY SUB TYPE DEFAULT ANY EAN8 EAN13 GS1 128 GS1 DATABAR EXPANDED GS1 DATABAR EXPANDED STACKED GS1 DATABAR LIMITED GS1 DATABAR OMNI GS1 DATABAR STACKED GS1 DATABAR STACKED OMNI GS1 DATABAR TRUNCATED UPC A UPC E USE PRESEARCH DEFAULT DISABLE FINDER PATTERN BASE STAT BASE CELL NUMBER X DEFAULT ANY CELL NUMBER Y DEFAULT ANY CELL SIZE INPUT UNITS DEFAULT PIXEL WORLD ENCODING DEFAULT ANY ENC ALPHA ENC ALPHANUM ENC ALPHANUM PUNC ENC ASCII ENC AUSTRALIA MAIL C ENC AUSTRALIA MAIL N ENC AUSTRALIA MAIL RAW ENC AZTEC COMPACT ENC AZTEC FULL RANGE ENC AZTEC RUNE ENC EAN8 ENC EAN8 ADDON ENC EAN13 ENC EAN13 ADDON ENC GS1 128 MICROPDF417 ENC GS1 128 PDF417 ENC GS1 DATABAR EXPANDED ENC GS1 DATABAR EXPANDED STACKED ENC GS1 DATABAR LIMITED ENC GS1 DATABAR OMNI ENC GS1 DATABAR STACKED ENC GS1 DATABAR STACKED OMNI ENC GS1 DATABAR TRUNCATED ENC ISO8 ENC KOREA MAIL ENC MODE2 ENC MODE3 ENC MODE4 ENC MODE5 ENC MODE6 ENC NUM ENC QRCODE MODEL1 ENC QRCODE MODEL2 ENC STANDARD ENC UK MAIL ENC UPCA ENC UPCA ADDON ENC UPCE ENC UPCE ADDON ENC US MAIL ERROR CORRECTION DEFAULT ANY ECC 4STATE ECC 200 ECC CHECK DIGIT ECC COMPOSITE ECC H ECC L ECC M ECC NONE ECC Q ECC REED SOLOMON ECC REED SOLOMON n FOREGROUND VALUE DEFAULT FOREGROUND ANY FOREGROUND BLACK FOREGROUND WHITE TRAIN DEFAULT DISABLE ENABLE GRADING STANDARD EDITION DEFAULT ISO 15415 2011 15416 2000 ISO 15415 2011 15416 2016 ISO 15416 2000 ISO 15416 2016 ISO 29158 2011 SEMI T10 0701 CELL SIZE MODE DEFAULT AUTO USER DEFINED CELL SIZE VALUE DEFAULT DOT SHAPE DEFAULT CIRCLE SQUARE DOT SIZE DEFAULT RESULT OUTPUT UNITS DEFAULT ACCORDING TO CALIBRATION PIXEL WORLD STRING FORMAT DEFAULT AUTO FORMAT GS1 HUMAN READABLE JAPANESE KOREAN LATIN RAW DATA SIMPLIFIED CHINESE UPCE COMPRESSED UTF8 STOP DETECT DEFAULT M_ECC_REED_SOLOMON_n