ClassPrefix_SetAttribute[type]
IVI Inherent Function
To form the ClassPrefix_ of the function name, use the prefix of the class driver with which you are working. For example, if you are working with the IviDmm class driver, use the prefix IviDmm_ to create the correct function name, IviDmm_SetAttribute[type].
ClassPrefix_SetAttributeViInt32
ClassPrefix_SetAttributeViReal64
ClassPrefix_SetAttributeViBoolean
ClassPrefix_SetAttributeViSession
ClassPrefix_SetAttributeViString
C Function Prototype
ViStatus ClassPrefix_SetAttributeViInt32 (ViSession vi, ViConstString channel,ViAttr attributeID, ViInt32 attributeValue);
ViStatus ClassPrefix_SetAttributeViReal64 (ViSession vi, ViConstString channel,ViAttr attributeID, ViReal64 attributeValue);
ViStatus ClassPrefix_SetAttributeViBoolean (ViSession vi, ViConstString channel,ViAttr attributeID, ViBoolean attributeValue);
ViStatus ClassPrefix_SetAttributeViSession (ViSession vi, ViConstString channel,ViAttr attributeID, ViSession attributeValue);
ViStatus ClassPrefix_SetAttributeViString (ViSession vi, ViConstString channel,ViAttr attributeID, ViChar[] attributeValue);
Purpose
These functions set the value of an attribute. A separate typesafe function exists for each possible attribute data type.
These are low-level functions that you can use to set the values of class attributes and inherent IVI attributes. If the attribute represents an instrument state, the function performs instrument I/O in the following cases:
- State caching is disabled for the entire session or for the particular attribute.
- State caching is enabled and the currently cached value is invalid or is different than the value you specify.
The class driver contains high-level functions that set most of the instrument attributes. It is best to use the high-level driver functions as much as possible. They handle order dependencies and multithread locking for you. In addition, they perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the SetAttribute functions, the functions check the instrument status after each call.
Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.
Parameters
Name | Type | Description | ||
---|---|---|---|---|
vi | ViSession | The instrument handle that you obtain from the ClassPrefix_init or ClassPrefix_InitWithOptions functions. The handle identifies a particular IVI session. | ||
channel | ViConstString | If the attribute is channel-based, pass a channel string or virtual channel name. Otherwise, pass VI_NULL or an empty string.
|
||
attributeID | ViAttr | The ID of the attribute. | ||
attributeValue | depends on the data type of the attribute | The value to which you want to set the attribute. |