GetErrorMessage

IVI Library

Ivi_GetErrorMessage

Usage

ViStatus Ivi_GetErrorMessage(ViStatus statusCode, ViChar statusMessage[ ]);

Purpose

This function converts an IVI or VISA status code into a meaningful message string. For all other values, it reports the "Unknown status value" message and returns the VI_WARN_UNKNOWN_STATUS warning code.

If you have a table of error codes and messages that are specific to the instrument driver, call Ivi_GetSpecificDriverStatusDesc instead.

Parameters

Name Type Description
statusCode ViStatus

A status code that an IVI function, a VISA function, or an instrument driver function returns.

statusMessage ViChar[ ]

Returns a meaningful message string for an IVI or VISA status code. For other status codes, returns "Unknown status value".

You must pass a ViChar array that contains at least IVI_MAX_MESSAGE_BUF_SIZE (256) bytes.

Return Value

Contains the status code that the function call returns. IVI engine functions can return error and warning values from several sets of status codes. Some status codes are unique to the IVI engine. Other status codes are the same codes that VISA Library functions return. Still others are error or warning values that functions in specific instrument drivers return. Each set of status codes has its own numeric range.

Regardless of the source of the status code, 0 always indicates success, a positive value indicates a warning, and a negative value indicates an error.

Related Topic

IVI Status Codes