Admin Production ni-theme
Current Publication

Ivi_GetClassDriverStatusDesc

IVI Compliance Package

Ivi_GetClassDriverStatusDesc

Usage

ViStatus Ivi_GetClassDriverStatusDesc (ViSession vi, ViStatus statusCode, ViChar statusMessage[], IviStringValueTable additionalTableToSearch);

Purpose

This function converts a status code that an instrument or class driver function returns into a meaningful message string. It interprets IVI and VISA status codes just as Ivi_GetErrorMessage does, but it also allows you to pass a table of error codes and messages that are specific to the class driver.

Use this function to implement the <CLASSPREFIX>_GetError and <CLASSPREFIX>_error_message functions in the class driver.

If the function cannot find a description for the status code, it reports the "Unknown status value" message and returns the VI_WARN_UNKNOWN_STATUS warning code.

Parameters

Input
Name Type Description
vi ViSession The ViSession handle that you obtain from Ivi_SpecificDriverNew. The handle identifies a particular IVI session.
statusCode ViStatus A status code that an instrument or class driver function returns.
additionalTableToSearch IviStringValueTable Specify a string/value table that contains status codes specific to the class driver. Specify a message string for each status code in the table. Terminate the table with an entry that has VI_NULL in the string field.

The ivi.h include file defines the structure of a string/value table entry as follows:

typedef struct
{
  ViInt32  value;
  ViString  string;
} IviStringValueEntry;


If you pass VI_NULL for this parameter, the function behaves the same as Ivi_GetErrorMessage.
Output
Name Type Description
statusMessage ViChar[] Returns a meaningful message string for an IVI, VISA, or instrument or class driver status code. If the status code is unknown, it 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