GetNthAttribute

IVI Library

Ivi_GetNthAttribute

Usage

ViStatus Ivi_GetNthAttribute(ViSession vi, ViInt32 index, ViAttr* attributeID);

Purpose

This function obtains the ID of the attribute that is at the index you specify in the IVI session's internal list of attributes. The index is 1-based.

If the index you specify is greater than the number of attributes, the function sets the Attribute ID parameter to IVI_ATTR_NONE (-1) and returns VI_SUCCESS.

Call Ivi_GetNumAttributes to determine the number of attributes in the internal list.

Parameters

Name Type Description
vi ViSession

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

index ViInt32

Specify a 1-based index into the IVI session's internal list of attributes.

attributeID ViAttr*

Returns the ID of the attribute at the selected index of the attribute list.

If the index you specify is greater than the number of attributes, the function sets this parameter to IVI_ATTR_NONE (-1) and returns VI_SUCCESS.

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