| MIL 10 Reference
| Customize Help
| Save Settings

MfuncErrorReport



See also
Availability
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
Report an error message.
Syntax
MIL_INT MfuncErrorReport(
MIL_ID ContextFuncId, //in
MIL_INT ErrorCode, //in
MIL_CONST_TEXT_PTR ErrorMessage, //in
MIL_CONST_TEXT_PTR ErrorSubMessage1, //in
MIL_CONST_TEXT_PTR ErrorSubMessage2, //in
MIL_CONST_TEXT_PTR ErrorSubMessage3 //in
)
Description

This function allows you to log an error message in a user-defined MIL function using the MIL error handling mechanism. You can call the MfuncErrorReport() function from both the slave and the master functions of your user-defined MIL function, but only after a call to MfuncAlloc() and before a call to MfuncFree(). When MfuncErrorReport() is called, MIL will treat your error as a normal MIL error. To report the logged messages to screen, you must enable error reporting using the MappControl() function. These errors can also be read using the standard MIL error functions (MappGetError()), which is especially useful when you want to keep error reporting disabled.

If you report an error with an error code set to M_NULL, you will reset any pending internal error that a MIL function call might have generated inside the user-defined MIL function. You must reset the pending error if you don't want the MIL error message to be reported. If you don't reset the pending error at the end of the slave function, and you don't report your own error, MIL will detect any pending error and report the error message, prefixed with the name of the user-defined MIL function.

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
ContextFuncId

Specifies the MIL function identifier. This parameter can be set to the following values:

function map For the MIL function identifier
CollapseValue Description
Collapse M_DEFAULT

Specifies the default MIL function identifier. Use this value when MfuncErrorReport() is called from within a slave function.

(summarize)
Collapse MIL function identifier

Specifies the identifier of a user-defined function.

ErrorCode

Specifies a numeric code to the user-defined MIL function's group of error messages. To specify the error code, combine the value in the table below with an offset. For example, M_FUNC_ERROR + 65.

function map For assigning a numeric code
CollapseValue Description
Collapse M_NULL

Specifies that no error message will be returned. Any pending internal error generated by a MIL function call inside the user-defined MIL function will be reset.

(summarize)
Collapse M_FUNC_ERROR +

Specifies a numeric code to a group of error messages. By specifying this value, you ensure that the error messages of the user-defined MIL function do not conflict with MIL specific errors.

(summarize)
Combination constant for M_FUNC_ERROR.

You can add the following value to the above-mentioned value to specify the offset.

function map For specifying the offset
CollapseCombination value Description
Collapse 0 <= Value <= 99

Specifies the value of the offset.

ErrorMessage

Specifies the text of your error message to report.

function map For specifying the text of the error message
CollapseValue Description
Collapse MIL_TEXT("ErrorMessage") 1

Specifies the text of your error message; this is a null-terminated string.

The error message, including the terminating null character ("\0"), must not be longer than M_ERROR_MESSAGE_SIZE (320) characters.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

ErrorSubMessage1

Specifies the text of your first error sub-message to report.

function map For specifying the text of the first error sub-message
CollapseValue Description
Collapse M_NULL

Specifies that you do not want to use this error sub-message.

Collapse MIL_TEXT("ErrorMessage") 1

Specifies the text of your error message; this is a null-terminated string.

The error message, including the terminating null character ("\0"), must not be longer than M_ERROR_MESSAGE_SIZE (320) characters.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

ErrorSubMessage2

Specifies the text of your second error sub-message to report.

function map For specifying the text of the second error sub-message
CollapseValue Description
Collapse M_NULL

Specifies that you do not want to use this error sub-message.

Collapse MIL_TEXT("ErrorMessage") 1

Specifies the text of your second error sub-message.

For details on creating appropriate error sub-messages, see the description of the ErrorSubMessage1 parameter.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

ErrorSubMessage3

Specifies the text of your third error sub-message to report.

function map For specifying the text of the third error sub-message
CollapseValue Description
Collapse M_NULL

Specifies that you do not want to use this error sub-message.

Collapse MIL_TEXT("ErrorMessage") 1

Specifies the text of your third error sub-message.

For details on creating appropriate error sub-messages, see the description of the ErrorSubMessage1 parameter.

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

Return value
The returned value is M_NULL if an error occurred during the error log operation; otherwise, not M_NULL.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT NULL FUNC ERROR NULL NULL NULL