GetViInt32EntryFromValue

IVI Library

Ivi_GetViInt32EntryFromValue

Usage

ViStatus Ivi_GetViInt32EntryFromValue(ViInt32 value, IviRangeTablePtr rangeTable, ViInt32* discreteOrMinValue, ViInt32* maxValue, ViInt32* coercedValue, ViInt32* tableIndex, ViString* commandString, ViInt32* commandValue);

Purpose

This function finds the first range table entry that applies to the ViInt32 value you specify. If the function finds an entry, it returns the contents of the entry. If it does not find an entry, it returns an IVI_ERROR_INVALID_VALUE error.

If the range table type is IVI_VAL_DISCRETE, function searches for a match on the discreteOrMinValue field of each entry.

If the range table type is IVI_VAL_RANGED or IVI_VAL_COERCED, the function searches until the value you specify falls within the range between the discreteOrMinValue and maxValue fields of an entry. The value falls within the range if it is greater than or equal to the discreteOrMinValue and less than or equal to the maxValue.

The function returns the discreteOrMinValue, maxValue, and coercedValue fields as ViInt32 values.

Parameters

Name Type Description
value ViInt32

Specify the value that you want to find in the range table.

rangeTable IviRangeTablePtr

Specify the address of the range table in which to search for the value.

discreteOrMinValue ViInt32*

If the search succeeds, this parameter returns the value of the discreteOrMinValue field of the entry.

You can pass VI_NULL for the parameter if you are not interested in this value.

maxValue ViInt32*

If the search succeeds, this parameter returns the value of the maxValue field of the entry.

You can pass VI_NULL for the parameter if you are not interested in this value.

coercedValue ViInt32*

If the search succeeds, this parameter returns the value of the coercedValue field of the entry.

You can pass VI_NULL for the parameter if you are not interested in this value.

tableIndex ViInt32*

If the search succeeds, this parameter returns the 0-based index of the entry.

You can pass VI_NULL for the parameter if you are not interested in this value.

commandString ViString*

If the search succeeds, this parameter returns the pointer in the cmdString field of the entry.

Do not change the contents of the string.

You can pass VI_NULL for the parameter if you are not interested in this value.

commandValue ViInt32*

If the search succeeds, this parameter returns the value of the cmdValue field of the entry.

You can pass VI_NULL for the parameter if you are not interested in this value.

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