| Customize Help
| Save Settings

MfuncErrorReport



Function Map
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 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
ContextFuncId

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

function map For the MIL function identifier
Click to summarizeValue Description
Click to summarize M_DEFAULT

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

(summarize)
Click to summarize 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
Click to summarizeValue Description
Click to summarize 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)
Click to summarize 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 value 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
Click to summarizeCombination value Description
Click to summarize 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
Click to summarizeValue Description
Click to summarize 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
Click to summarizeValue Description
Click to summarize M_NULL

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

Click to summarize 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
Click to summarizeValue Description
Click to summarize M_NULL

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

Click to summarize 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
Click to summarizeValue Description
Click to summarize M_NULL

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

Click to summarize 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