niScope_GetError
- Updated2023-02-21
- 2 minute(s) read
C Function Prototype
ViStatus niScope_GetError (ViSession vi, ViStatus* errorCode, ViInt32 bufferSize, ViChar[] description);
Purpose
![]() |
Note This function is included for compliance with the IviScope Class Specification. |
Reads an error code and message from the error queue. National Instruments digitizers do not contain an error queue. Errors are reported as they occur. Therefore, this function does not detect errors.
Parameters
| Input | ||
| Name | Type | Description |
| vi | ViSession | The instrument handle you obtain from niScope_init that identifies a particular instrument session. |
| errorCode | ViStatus* | Pass the Error Code that is returned from any of the instrument driver functions. |
| Output | ||
| Name | Type | Description |
| bufferSize | 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 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. If you pass 0, you can pass VI_NULL for the description 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 bufferSize, 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
niScope_GetErrorMessage.
To obtain additional information concerning the error
condition, use niScope_GetError
and
niScope_ClearError.
The general meaning of the status code is as follows:
|
