niHSDIO_GetError

NI Digital Waveform Generator/Analyzer

niHSDIO_GetError

Specific Function

C Function Prototype

ViStatus niHSDIO_GetError (ViSession vi, ViStatus* errorCode, ViInt32 errorDescriptionBufferSize, ViChar[ ] errorDescription);

Purpose

Returns the error information associated with the instrument handle. This function retrieves and then clears the error information for the session. If vi is VI_NULL, this function retrieves and then clears the error information for the current thread.

Parameters

Name Type Description
vi ViSession This handle identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function.
errorCode ViStatus Returns the error code for the session or execution thread.
errorDescriptionBufferSize ViInt32 Passes the number of bytes in the ViChar array you specify for the errorDescription parameter.

If the error description, including the terminating NULL byte, contains more bytes than you indicate in this parameter, the function copies BufferSize - 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.
errorDescription 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 errorDescriptionBufferSize, you can pass VI_NULL for this parameter.

Return Value