NI-SCOPE C Function Reference

niScope_GetErrorMessage

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

C Function Prototype

ViStatus niScope_GetErrorMessage (ViSession vi, ViStatus errorCode, ViInt32 bufferSize, ViChar errorMessage[]);

Purpose

Returns the error code from an NI-SCOPE function as a user-readable string. Use VI_NULL as the default instrument handle.

You must call this function twice. For the first call, set bufferSize to 0 to prevent the function from populating the error message. Instead, the function returns the size of the error string. Use the returned size to create a buffer, then call the function again, passing in the new buffer and setting bufferSize equal to the size that was returned in the first function call.

Parameters

Input
Name Type Description
vi ViSession The instrument handle you obtain from niScope_init that identifies a particular instrument session.
errorCode ViStatus The error code that is returned from any of the instrument driver functions.
bufferSize The number of characters you specify for the errorMessage parameter.
Output
Name Type Description
errorMessage[] ViChar Returns a char buffer that will be populated with the error message. It should be at least as large as the buffer size.

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:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Log in to get a better experience