GetStringFromTable

IVI Library

Ivi_GetStringFromTable

Usage

ViStatus Ivi_GetStringFromTable(IviStringValueTable stringTable, ViInt32 value, ViString* string);

Purpose

This function searches for a value in a string/value table and returns the string that corresponds to the value.

If the function cannot find the value in the table, it returns the IVI_ERROR_INVALID_VALUE error code.

Parameters

Name Type Description
stringTable IviStringValueTable

Specify the string/value table in which you want to find the string.

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

typedef struct

{
ViInt32  value;
ViString  string;
} IviStringValueEntry;

value ViInt32

Specify the value you want to find in the string/value table.

string ViString*

If the function finds a string/value table entry that contains the value you specify, this parameter returns the address of the string in the entry.

Do not modify the contents of the string.

If the function does not find the value in the table, this parameter returns VI_NULL, and the function returns the IVI_ERROR_INVALID_VALUE error code.

You can pass VI_NULL for this parameter.

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