niDMM_GetError

NI-DMM C/CVI/VB

niDMM_GetError

ViStatus = niDMM_GetError(ViSession Instrument_Handle, ViStatus *Error Code, ViInt32 Buffer_Size, ViChar Description[])

Purpose

Returns the error information associated with the Instrument_Handle. This function retrieves and then clears the error information for the session. If you leave the Instrument_Handle unwired, this function retrieves and then clears the error information for the process.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies a particular instrument session. You obtain the Instrument_Handle parameter from niDMM_init or niDMM_InitWithOptions. The default is None.
Buffer_Size ViInt32 Passes the number of bytes in the ViChar array you specify for the Description parameter. If the error description, including the terminating NULL byte, contains more bytes than you indicate in this parameter, the function copies Buffer_Size –1 bytes into the buffer, places an ASCII NULL byte at the end of the buffer, and returns the Buffer_Size you must pass to get the entire value.

For example, if the value is "123456" and the Buffer_Size is 4, the function places "123" into the buffer and returns 7. If you pass a negative number, the function copies the value to the buffer regardless of the number of bytes in the value. If you pass 0, you can pass VI_NULL for the Description buffer parameter. The default value is None.

Output
Name Type Description
Error_Code ViStatus* Returns the Error_Code for the session or execution thread. If you pass 0 for the Buffer_Size, you can pass VI_NULL for this parameter.
Description ViChar[] Returns the error Description for the IVI session or execution thread. If there is no Description, the function returns an empty string. The buffer must contain at least as many elements as the value you specify with the Buffer_Size parameter. If you pass 0 for the Buffer_Size, you can pass VI_NULL for this parameter.

Return Value

Name Type Description
Status ViStatus Reports the Status of this operation. To obtain a text description of the status code, call niDMM_error_message. To obtain additional information concerning the error condition, use niDMM_GetError.