| MIL 10 Reference
| Customize Help
| Save Settings

MmetGetResult



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Get the specified type of results from a MIL metrology result buffer.
Syntax
void MmetGetResult(
MIL_ID ResultId, //in
MIL_INT LabelOrIndex, //in
MIL_INT64 ResultType, //in
void *ResultArrayPtr //out
)
Description

This function retrieves all results of the specified type from a metrology result buffer, after an MmetCalculate() call. The result entries are ordered by label value.

If your target image was associated with a calibration context, positional and dimensional results are, by default, returned with respect to the relative coordinate system of the image. Otherwise, these results are returned in pixels, relative to the top-left pixel in the target image.

If your target image was associated with a calibration context but you want to retrieve positional and dimensional results in pixel units, use MmetControl() with the M_RESULT_OUTPUT_UNITS control type set to M_PIXEL. However, note that if you set M_RESULT_OUTPUT_UNITS to M_WORLD without specifying a calibrated image in which to calculate the results, MmetGetResult() will generate an error.

All results are returned relative to the output reference frame that you set using MmetControl() with M_OUTPUT_FRAME.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
ResultId

Specifies the identifier of the metrology result buffer from which to get results.

LabelOrIndex

Specifies the feature or geometric tolerance for which to get results. Labels must be greater than 0 while indices can be equal to 0.

To specify a context, feature, geometric tolerance, or result buffer, select the following.

function map For specifying a context, feature, tolerance, or result buffer
CollapseValue Description
Collapse M_DEFAULT

Same as M_GENERAL.

Collapse

Specifies the index value of an existing individual feature for which to get results.

(summarize)
Parameters

Specifies the index.

Collapse

Specifies the label of an existing individual feature for which to get results.

(summarize)
Parameters

Specifies the label.

Collapse

Specifies the index value of an existing individual tolerance for which to get results.

(summarize)
Parameters

Specifies the index.

Collapse

Specifies the label value of an existing individual tolerance for which to get results.

(summarize)
Parameters

Specifies the label.

Collapse M_ALL_FEATURES

Specifies to return results about all features. This should be used only with M_STATUS.

(summarize)
Collapse M_ALL_TOLERANCES

Specifies to return results about all tolerances. This should be used only with M_STATUS.

(summarize)
Collapse M_CONSTRUCTED_FEATURES

Specifies to return results about all constructed features. This should be used only with M_STATUS.

(summarize)
Collapse M_GENERAL

Specifies that the results relating to the entire metrology context will be returned.

Collapse M_GLOBAL_FRAME

Specifies that information about the global frame of the context will be returned.

Collapse M_MEASURED_FEATURES

Specifies to return results about all measured features. This should be used only with M_STATUS.

(summarize)
ResultType

Specifies the type of result to retrieve.

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

ResultArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of type MIL_DOUBLE
  • array of type MIL_ID
  • array of type MIL_INT
  • array of type MIL_INT32
  • array of type MIL_INT64
  • MIL_DOUBLE
  • MIL_ID
  • MIL_INT
  • MIL_INT32
  • MIL_INT64

Specifies the address of the first element of the array in which to write the requested information.

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

The tables below list possible values for the ResultType parameter and possible values returned to the ResultArrayPtr parameter.

To retrieve general results, the LabelOrIndex parameter must be set to M_GENERAL.

Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE.

function map For retrieving general results
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_NUMBER_OF_CONSTRUCTED_FEATURES +

Retrieves the number of constructed features.

(summarize)
Collapse M_NUMBER_OF_FEATURES +

Retrieves the total number of features. This total includes both measured features and constructed features.

(summarize)
Collapse M_NUMBER_OF_FEATURES_FAIL +

Retrieves the number of features that are not successfully calculated. The status of those features is M_FAIL.

(summarize)
Collapse M_NUMBER_OF_FEATURES_PASS +

Retrieves the number of features that are successfully calculated. The status of those features is M_PASS.

(summarize)
Collapse M_NUMBER_OF_MEASURED_FEATURES +

Retrieves the number of measured features.

(summarize)
Collapse M_NUMBER_OF_TOLERANCES +

Retrieves the number of tolerances.

(summarize)
Collapse M_NUMBER_OF_TOLERANCES_FAIL +

Retrieves the number of tolerances that have the status M_FAIL, which is the resulting status when tolerance values are smaller than M_VALUE_MIN or greater than M_VALUE_MAX.

(summarize)
Collapse M_NUMBER_OF_TOLERANCES_PASS +

Retrieves the number of tolerances that have the status M_PASS, which is the resulting status when it is not M_FAIL or M_WARNING.

(summarize)
Collapse M_NUMBER_OF_TOLERANCES_WARNING +

Retrieves the number of tolerances that have the status M_WARNING, which is the resulting status when tolerance values are greater or equal to M_VALUE_MIN and lower than M_VALUE_WARNING_MIN. It also occurs when tolerance values are lower or equal to M_VALUE_MAX and greater than M_VALUE_WARNING_MAX.

(summarize)
Collapse M_TIMEOUT_END +

Retrieves whether the timeout has been reached. You can set the timeout limit using MmetControl() with M_TIMEOUT. By default, there is no limit.

(summarize)
Collapse M_FALSE

Specifies that the timeout has not been reached.

Collapse M_TRUE

Specifies that the timeout has been reached.

To retrieve results for features, the LabelOrIndex parameter can be set to M_GLOBAL_FRAME or an existing feature label or index using M_FEATURE_LABEL() or M_FEATURE_INDEX().

Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE.

function map For retrieving results for features
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_ANGLE +

Retrieves the aperture of an arc or the angle of a segment, a line, or a local frame. The angle is measured in degrees, relative to the output coordinate system specified using MmetControl() with M_RESULT_OUTPUT_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 25: Calibrating your camera setup.

(summarize)
Collapse M_ANGLE_END +

Retrieves the end angle of an arc. The angle is measured in degrees, relative to the output coordinate system specified using MmetControl() with M_RESULT_OUTPUT_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 25: Calibrating your camera setup.

(summarize)
Collapse M_ANGLE_START +

Retrieves the start angle of an arc. The angle is measured in degrees, relative to the output coordinate system specified using MmetControl() with M_RESULT_OUTPUT_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 25: Calibrating your camera setup.

(summarize)
Collapse M_COVERAGE +

Retrieves the portion of the feature that was covered by the fitted edgels, as a percentage. If the fitted edgels of the feature completely cover all of the possible edgels of the feature (before the fit), M_COVERAGE returns 100%.

You can retrieve M_COVERAGE for physically measured or constructed arcs, circles, and segments. For features that have not been fit, the coverage is 100%.

(summarize)
Collapse M_LENGTH +

Retrieves the perimeter of a circle or the length of a segment or arc feature.

(summarize)
Collapse M_LINE_A +

Retrieves the coefficient A of the equation for a constructed line.

The line equation is: A x + B y + C = 0.

(summarize)
Collapse M_LINE_B +

Retrieves the coefficient B of the equation for a constructed line.

The line equation is: A x + B y + C = 0.

(summarize)
Collapse M_LINE_C +

Retrieves the coefficient C of the equation for a constructed line.

The line equation is: A x + B y + C = 0.

(summarize)
Collapse M_NUMBER +

Retrieves the number of subfeatures in a multiple feature or the number of edgels in an edgel feature.

(summarize)
Collapse M_POSITION_END_X +

Retrieves the X-coordinate of the ending point of a segment or arc.

(summarize)
Collapse M_POSITION_END_Y +

Retrieves the Y-coordinate of the ending point of a segment or arc.

(summarize)
Collapse M_POSITION_START_X +

Retrieves the X-coordinate of the starting point of a segment or arc.

(summarize)
Collapse M_POSITION_START_Y +

Retrieves the Y-coordinate of the starting point of a segment or arc.

(summarize)
Collapse M_POSITION_X +

Retrieves the X-coordinate of a point or edgel, the X-coordinate of the center of a circle or arc, or the X-coordinate of the origin of a local frame. For measured points and edgels, you must retrieve M_NUMBER to allocate the appropriate size of the array.

(summarize)
Collapse M_POSITION_Y +

Retrieves the Y-coordinate of a point or edgel, the Y-coordinate of the center of a circle or arc, or the Y-coordinate of the origin of a local frame. For measured points and edgels, you must retrieve M_NUMBER to allocate the appropriate size of the array.

(summarize)
Collapse M_RADIUS +

Retrieves the radius of a circle or arc feature.

(summarize)

To retrieve tolerance results, the LabelOrIndex parameter can be set to an existing tolerance label or index using M_TOLERANCE_LABEL() or using M_TOLERANCE_INDEX().

Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE.

function map For retrieving results for tolerances
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_TOLERANCE_VALUE +

Retrieves the calculated geometric tolerance value.

(summarize)

To retrieve results for features, the LabelOrIndex parameter can be set to M_GLOBAL_FRAME or an existing feature label or index using M_FEATURE_LABEL() or M_FEATURE_INDEX(). To retrieve tolerance results, the LabelOrIndex parameter can be set to an existing tolerance label or index using M_TOLERANCE_LABEL() or using M_TOLERANCE_INDEX().

Unless otherwise specified, the following values require that you pass the ResultArrayPtr parameter the address of a MIL_DOUBLE.

function map For retrieving results for features or tolerances
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_LABEL_VALUE +

Retrieves the label of a specific feature or a specific tolerance.

(summarize)
Collapse M_STATUS +

Retrieves the status of the calculation of features and tolerances.

When multiple features or tolerances are specifed (LabelOrIndex set to M_ALL_FEATURES, M_CONSTRUCTED_FEATURES, M_MEASURED_FEATURES, M_ALL_TOLERANCES, or M_GENERAL), the status is M_FAIL unless the individual statuses of each feature or tolerance being queried is M_PASS. Note that when LabelOrIndex is set to M_GENERAL, all tolerances and all features in the entire metrology context are queried.

The geometric tolerance's status is determined by whether it (M_TOLERANCE_VALUE) adheres to the thresholds set using MmetControl() with M_VALUE_MAX, M_VALUE_MIN, M_VALUE_WARNING_MAX, and M_VALUE_WARNING_MIN. The following is an example of (non-zero) minimum and maximum tolerance value and warning value thresholds:

(summarize)
Collapse M_FAIL

Specifies that the feature was not calculated successfully, and/or the tolerance has not passed all restrictions.

Collapse M_PASS

Specifies that the feature was calculated successfully, and/or the geometric tolerance has passed all restrictions.

Collapse M_WARNING

Specifies that the geometric tolerance has passed all restrictions, with a warning. Warnings can be used to advise you when a tolerance is at its limit, and is in danger of failing.

(summarize)

You can add the following value to the above-mentioned values to determine whether a result is available.

function map For determining whether results are available
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_AVAILABLE

Retrieves whether a result is available to be returned.

(summarize)
Collapse ResultArrayPtr data type info

Data type: MIL_DOUBLE

Collapse M_NULL

Specifies that the result is not available to be retrieved.

Collapse Value != 0

Specifies that the result is available to be retrieved.

You can add one of the following values to the above-mentioned values to cast the requested results to the required data type.

function map For specifying the data type
CollapseResultType Description
ResultArrayPtr
- Possible values returned
Collapse M_TYPE_MIL_DOUBLE

Casts the requested results to a MIL_DOUBLE.

(summarize)
Collapse ResultArrayPtr data type info
  • Data type: array of type MIL_DOUBLE
    Array size: Depends on the result type.
    Note: When multiple results.

  • Data type: MIL_DOUBLE
    Note: When a single result.

Collapse M_TYPE_MIL_ID

Casts the requested results to a MIL_ID.

(summarize)
Collapse ResultArrayPtr data type info
  • Data type: array of type MIL_ID
    Array size: Depends on the result type.
    Note: When multiple results.

  • Data type: MIL_ID
    Note: When a single result.

Collapse M_TYPE_MIL_INT

Casts the requested results to a MIL_INT.

(summarize)
Collapse ResultArrayPtr data type info
  • Data type: array of type MIL_INT
    Array size: Depends on the result type.
    Note: When multiple results.

  • Data type: MIL_INT
    Note: When a single result.

Collapse M_TYPE_MIL_INT32

Casts the requested results to a MIL_INT32.

(summarize)
Collapse ResultArrayPtr data type info
  • Data type: array of type MIL_INT32
    Array size: Depends on the result type.
    Note: When multiple results.

  • Data type: MIL_INT32
    Note: When a single result.

Collapse M_TYPE_MIL_INT64

Casts the requested results to a MIL_INT64.

(summarize)
Collapse ResultArrayPtr data type info
  • Data type: array of type MIL_INT64
    Array size: Depends on the result type.
    Note: When multiple results.

  • Data type: MIL_INT64
    Note: When a single result.

Compilation information
Header Include mil.h.
Library Use mil.lib; milmetrol.lib.
DLL Requires mil.dll; milmetrol.dll.
DEFAULT ALL FEATURES ALL TOLERANCES CONSTRUCTED FEATURES GENERAL GLOBAL FRAME MEASURED FEATURES NUMBER OF CONSTRUCTED FEATURES NUMBER OF FEATURES NUMBER OF FEATURES FAIL NUMBER OF FEATURES PASS NUMBER OF MEASURED FEATURES NUMBER OF TOLERANCES NUMBER OF TOLERANCES FAIL NUMBER OF TOLERANCES PASS NUMBER OF TOLERANCES WARNING TIMEOUT END FALSE TRUE ANGLE ANGLE END ANGLE START COVERAGE LENGTH LINE A LINE B LINE C NUMBER POSITION END X POSITION END Y POSITION START X POSITION START Y POSITION X POSITION Y RADIUS TOLERANCE VALUE LABEL VALUE STATUS FAIL PASS WARNING AVAILABLE NULL TYPE MIL DOUBLE TYPE MIL ID TYPE MIL INT TYPE MIL INT32 TYPE MIL INT64 GENERAL DEFAULT FEATURE INDEX FEATURE LABEL GLOBAL FRAME TOLERANCE INDEX TOLERANCE LABEL GENERAL DEFAULT