ClassPrefix_GetError

IVI Driver Help

Edition Date: August 2011

Part Number: 370430H-01

»View Product Info
Download Help (Windows Only)

IVI Inherent Function

To form the ClassPrefix_ of the function name, use the prefix of the class driver with which you are working. For example, if you are working with the IviDmm class driver, use the prefix IviDmm_ to create the correct function name, IviDmm_GetError.

C Function Prototype

ViStatus ClassPrefix_GetError (ViSession vi, ViInt32 bufferSize, ViInt32 code, ViString description);

Purpose

This function retrieves and then clears the IVI error information for the session or the current execution thread. One exception exists: if the BufferSize parameter is 0, the function does not clear the error information. By passing 0 for the buffer size, the caller can ascertain the buffer size required to get the entire error description string and then call the function again with a sufficiently large buffer.

If you specify a valid IVI session for the vi parameter, Get Error retrieves and then clears the error information for the session. If you pass VI_NULL for the vi parameter, this function retrieves and then clears the error information for the current execution thread. If the vi parameter is an invalid session, the function does nothing and returns an error. Normally, the error information describes the first error that occurred since you last called ClassPrefix_GetError or ClassPrefix_ClearError.

Parameter

Inputs Type Description
vi ViSession The instrument handle that you obtain from the ClassPrefix_init or ClassPrefix_InitWithOptions functions. The handle identifies a particular IVI session.
BufferSize ViInt32 The number of bytes in the ViChar array that the user specifies for the ErrorDescription parameter.
BufferSize ViInt32 The number of bytes in the ViChar array that the user specifies for the ErrorDescription parameter.
Outputs Type Description
ErrorCode ViStatus Returns the error code. Zero indicates that no error occurred. A positive value indicates a warning. A negative value indicates an error. The user can pass VI_NULL if the user does not want to retrieve this value.
ErrorDescription ViChar[] Buffer into which the function copies the full formatted error string. The string describes the error code and any extra information regarding the error or warning condition. The buffer shall contain at least as many bytes as the user specifies in the ErrorDescriptionBufferSize parameter. The user can pass VI_NULL if the ErrorDescriptionBufferSize parameter is zero.

Return Values

WAS THIS ARTICLE HELPFUL?

Not Helpful