niModInst_GetExtendedErrorInfo

ModInst

niModInst_GetExtendedErrorInfo

Specific Function

C Function Prototype

ViStatus niModInst_GetExtendedErrorInfo (ViInt32 errorInfoBufferSize, ViChar errorInfo[]);

Description

Returns detailed information about the last error that occurred in the current thread during a call to one of the NI-ModInst functions. When one of the other functions returns a negative value as its return value, immediately call this function to get detailed information about the error. Because error information is stored on a thread-by-thread basis, be sure to call this function in the same thread that called the function that returned an error.

The extended error information is returned as a string. To find out the length of the error information string before you allocate a buffer for it, call this function and pass 0 as the errorInfoBufferSize parameter or NULL as the errorInfo parameter. When you do this, the function returns the size of the buffer required to hold the error information string as its return value. You can then allocate an appropriately sized string character buffer and call this function again.

Parameters

Name Type Description
errorInfoBufferSize ViInt32 The size of the buffer allocated and passed in as the errorInfo parameter. The buffer should be large enough to hold the errorInfo string (including a NULL terminating character). Refer to the Description section to find out how to determine the exact buffer size required.
errorInfo ViChar[] The character buffer into which the error information string is copied.

Return Value