viGetAttribute

Agilent VISA.NET

viGetAttribute

Syntax

viGetAttribute(ViSession/ViEvent/ViFindList vi, ViAttr attribute, ViAttrState attrState);

Description

This function retrieves the state of an attribute for the specified session.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession
ViEvent
ViFindList

Unique logical identifier to a session, event, or find list.

attribute

IN

ViAttr

Resource attribute for which the state query is made.

attrState

OUT

See Note below.

The state of the queried attribute for a specified resource. The interpretation of the returned value is defined by the individual resource. Note that you must allocate space for character strings returned.

Note: The pointer passed to viGetAttribute must point to the exact type required for that attribute, ViUInt16, ViInt32, etc. For example, when reading an attribute state that returns a ViChar, you must pass a pointer to a ViChar variable. You must allocate space for the returned data.

Return Values

Type ViStatus

This is the function return status. It returns either a completion code or an error code as follows.

Completion Code

Description

VI_SUCCESS

Resource attribute retrieved successfully.

Error Codes

Description

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

VI_ERROR_NSUP_ATTR

The specified attribute is not defined by the referenced resource.

See Also

viSetAttribute