Synopsis
Control an application environment setting.
Format
void MappControl(ControlType, ControlFlag)
long ControlType; | Type of event to control |
long ControlValue; | Flag to control event |
Description
This function controls the output of error messages to the screen, the output of function names and parameters to the screen at the start and end of MIL functions, and parameter checking at the start of MIL functions. It also controls the processing and memory compensation modes.
The ControlType and ControlValue parameters specify the type of event to control and the flag with which to control the event. These parameters should be set according to the following combinations:
ControlType | ControlValue | Result |
M_ERROR | M_PRINT_ENABLE | Enable printing of error messages (default) |
M_ERROR | M_PRINT_DISABLE | Disable printing of error messages |
M_TRACE | M_PRINT_ENABLE | Enable printing of function names and parameters |
M_TRACE | M_PRINT_DISABLE | Disable printing of function names and parameters (default) |
M_PARAMETER | M_CHECK_ENABLE | Enable checking of parameters (default) |
M_PARAMETER | M_CHECK_DISABLE | Disable checking of parameters |
M_PROCESSING | M_COMPENSATION_ENABLE | Enable processing compensation; if your system cannot perform a certain processing operation due to its limitations, processing will be done by the Host. (default) |
M_PROCESSING | M_COMPENSATION_DISABLE | Disable processing compensation. |
M_MEMORY | M_COMPENSATION_ENABLE | Enable memory compensation; if your system cannot perform a certain memory (buffer) allocation due to insufficient memory. |
M_MEMORY | M_COMPENSATION_DISABLE | Disable memory compensation (default). |
In multi-thread environments, an MappControl call applies to all application threads running MIL unless specifically limited to the calling thread by adding M_THREAD_CURRENT to the ControlType parameter. For example, MappControl (M_TRACE, M_PRINT_ENABLE) called from any application thread enables trace printing in all threads running MIL. However, MappControl (M_TRACE+M_THREAD_CURRENT, M_PRINT_ENABLE) will enable trace printing in the currently running thread only and ignore calls from other threads. To restore all-thread trace printing, within the same thread call MappControl (M_TRACE+M_THREAD_CURRENT, M_DEFAULT).
If error printing is disabled, you can still check for error, using MappGetError.
Note, if parameter checking is disabled to accelerate an application, unpredictable behavior can be expected when passing invalid parameters to a function.
See also