GetAttrMinMaxViReal64

IVI Library

Ivi_GetAttrMinMaxViReal64

Usage

ViStatus Ivi_GetAttrMinMaxViReal64(ViSession vi, ViChar repeatedCapability[ ], ViAttr attributeID, ViReal64* minimum, ViReal64* maximum, ViBoolean* hasMinimum, ViBoolean* hasMaximum);

Purpose

This function returns the minimum and maximum values that an instrument implements for a ViReal64 attribute on a specific repeated capability. The values represent the minimum and maximum values the driver or instrument actually uses rather than the possible values you can pass to Ivi_SetAttributeViReal64. In particular, for a coerced range table, the function uses the coercedValue fields.

The function calls Ivi_GetAttrRangeTable to obtain the range table for the attribute. If the attribute has no range table or the table is invalid, the function returns an error.

The hasMin and hasMax fields in the range table indicate whether, as a whole, the table contains a meaningful minimum value and a meaningful maximum value. The function returns these indicators.

If the hasMin field in the table is non-zero, the function searches the table for the minimum value. For discrete and ranged tables, the function examines the discreteOrMinValue field in each entry. For coerced tables, the function examines the coercedValue field.

If the hasMax field in the table is non-zero, the function searches the table for the maximum value. For discrete tables, the function examines the discreteOrMinValue field in each entry. For ranged tables, the function examines the maxValue field. For coerced tables, the function examines the coercedValue field.

Parameters

Name Type Description
vi ViSession

The ViSession handle that you obtain from Ivi_SpecificDriverNew. The handle identifies a particular IVI session.

repeatedCapability ViChar[ ]

If the attribute is repeated capability-based, specify a particular repeated capability. If the attribute you specify is not repeated capability-based, pass VI_NULL or an empty string.

attributeID ViAttr

Pass the ID of an attribute for this parameter.

The include file for a specific instrument driver defines constant names for all of the user-accessible attributes that apply to the driver. This includes attributes that the IVI engine defines, attributes that the instrument class defines, and attributes that are specific to the particular instrument. Each defined constant name begins with PREFIX_ATTR_, where PREFIX is the specific instrument prefix.

For each IVI engine attribute, the specific driver include file uses the same constant name that appears in ivi.h, except that the specific instrument prefix replaces the IVI prefix. For example, ivi.h defines IVI_ATTR_CACHE, and the Fluke 45 include file, fl45.h, defines the following constant name:

#define FL45_ATTR_CACHEĀ  IVI_ATTR_CACHE

For each instrument class attribute, the specific driver include file uses the same constant name that appears in the instrument class include file, except that the specific instrument prefix replaces the class prefix. For example, the DMM class include file, ividmm.h, defines IVIDMM_ATTR_RANGE, and fl45.h defines the following constant name:

#define FL45_ATTR_RANGEĀ  IVIDMM_ATTR_RANGE

For each specific instrument attribute, the specific driver include file defines a constant name and assigns a value that is an offset from IVI_SPECIFIC_PUBLIC_ATTR_BASE. For example, fl45.h defines the following constant name:

#define FL45_ATTR_HOLD_THRESHOLD \ (IVI_SPECIFIC_PUBLIC_ATTR_BASE + 3L)

For each attribute that is private to an instrument driver, the instrument driver source file defines a constant name and assigns a value that is an offset from IVI_SPECIFIC_PRIVATE_ATTR_BASE. For example, hp34401a.c defines the following constant name:

#define HP34401A_ATTR_TRIGGER_TYPE \ (IVI_SPECIFIC_PRIVATE_ATTR_BASE + 1L)

minimum ViReal64*

If the range table for the attribute contains a meaningful minimum value, the function returns the minimum value in this parameter.

For tables of type IVI_VAL_DISCRETE or IVI_VAL_RANGED, the minimum value is the lowest discreteOrMinValue in the table.

For tables of type IVI_VAL_COERCED, the minimum value is the lowest coercedValue in the table.

If you are not interested in this value, you can pass VI_NULL.

maximum ViReal64*

If the range table for the attribute contains a meaningful maximum value, the function returns the maximum value in this parameter.

For tables of type IVI_VAL_DISCRETE or IVI_VAL_RANGED, the maximum value is the highest discreteOrMinValue in the table.

For tables of type IVI_VAL_RANGED, the maximum value is the highest maxValue in the table.

For tables of type IVI_VAL_COERCED, the maximum value is the highest coercedValue in the table.

If you are not interested in this value, you can pass VI_NULL.

hasMinimum ViBoolean*

Returns VI_TRUE (1) if the range table for the attribute indicates that it contains a meaningful minimum value. Otherwise, returns VI_FALSE (0).

If you are not interested in this value, you can pass VI_NULL.

If you are not interested in this value, you can pass VI_NULL.

hasMaximum ViBoolean*

Returns VI_TRUE (1) if the range table for the attribute indicates that it contains a meaningful maximum value. Otherwise, returns VI_FALSE (0).

If you are not interested in this value, you can pass VI_NULL.

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