NI-HSDIO C Function Reference

niHSDIO_GetError

  • Updated2023-02-21
  • 2 minute(s) read

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

Input
Name Type Description
vi ViSession Identifies your instrument session. vi was obtained from the niHSDIO_InitAcquisitionSession or niHSDIO_InitGenerationSession function.
Error Description Buffer Size 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.
Output
Name Type Description
Error Code ViStatus Returns the error code for the session or execution thread.
Error 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 errorDescriptionBufferSize, 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 the niHSDIO_error_message function. To obtain additional information concerning the error condition, use the niHSDIO_GetError and niHSDIO_ClearError functions.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Log in to get a better experience