viGetAttribute

NI-VISA

viGetAttribute

Purpose

Retrieves the state of an attribute.

C Syntax

ViStatus viGetAttribute(ViObject vi, ViAttr attribute, void * attrState)

Visual Basic Syntax

viGetAttribute&(ByVal vi&, ByVal attribute&, attrState as Any)

Resource Classes

All I/O session types, all event object types, VISA Resource Manager

Parameters

Name Direction Description

vi

IN

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

attribute

IN

Resource attribute for which the state query is made.

attrState

OUT

The state of the queried attribute for a specified resource. The interpretation of the returned value is defined by the individual object.

Return Values

Completion Codes Description

VI_SUCCESS

Attribute retrieved successfully.

 

Error Codes

Description

VI_ERROR_INV_OBJECT

The given object reference is invalid.

VI_ERROR_NSUP_ATTR

The specified attribute is not defined by the referenced object.

Description

The viGetAttribute() operation is used to retrieve the state of an attribute for the specified session, event, or find list.

The output parameter attrState is of the type of the attribute actually being retrieved. For example, when retrieving an attribute that is defined as a ViBoolean, your application should pass a reference to a variable of type ViBoolean. Similarly, if the attribute is defined as being ViUInt32, your application should pass a reference to a variable of type ViUInt32.

Related Topics

Attributes

VISA Resource Template

viSetAttribute