Admin Production ni-theme
Current Publication

SetBreakOnLibraryErrors

LabWindows/CVI

SetBreakOnLibraryErrors

int SetBreakOnLibraryErrors (int newState);

Purpose

When you enable debugging and a National Instruments library function reports an error, LabWindows/CVI can display a run-time error dialog box and suspend execution. You can use SetBreakOnLibraryErrors to enable or disable this feature.

In general, use the Run»Break on»Library ErrorsRun»Break on»Library Errors command in the Workspace window to enable or disable this feature. Use this function only when you want to temporarily disable the Run»Break on»Library Errors feature around a segment of code. This function changes the setting for the thread that calls this function.

SetBreakOnLibraryErrors does not affect the state of the Run»Break on»Library Errors option in the Workspace window.

If you disable run-time checking, SetBreakOnLibraryErrors has no effect. LabWindows/CVI never reports run-time errors when you disable run-time checking. Run-time checking is enabled when you set the debugging level in the Build Options dialog box of the Workspace window to Standard or Extended, and select a debug configurationdebug configuration.

Example Code

int oldValue;
oldValue = SetBreakOnLibraryErrors (0);
/* Function calls that may legitimately return errors. */
SetBreakOnLibraryErrors (oldValue);

Parameters

Input
Name Type Description
newState int Specifies the new break-on-library-errors state.

Specify a nonzero value or select Enabled in the function panel to display a run-time error dialog box and suspend execution when a National Instruments library function reports an error, if you enable debugging.

Specify 0 or select Disabled in the function panel if you do not want to suspend execution.

If you disable debugging, this parameter has no effect.

Return Value

Name Type Description
previousState int Previous state of the Run»Break on»Library Errors option.

Code Description
1 Run»Break on»Library Errors option is enabled.
0 Run»Break on»Library Errors option is disabled or debugging is disabled.

Additional Information

Library: Utility Library

Include file: utility.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later

Example

Refer to apps\uirview\uirview.cws for an example of using the SetBreakOnLibraryErrors function.