pi40iv_SetAttributeViInt32
ViStatus pi40iv_SetAttributeViInt32 (ViSession instrumentHandle,
ViChar _VI_FAR channelName[],
ViAttr attributeID,
ViInt32 attributeValue);
Purpose
This function sets the value of a ViInt32 attribute.
This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this 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.
This instrument 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
Input |
Name |
Type |
Description |
instrumentHandle |
ViSession |
The ViSession handle that you obtain from the pi40iv_init or pi40iv_InitWithOptions function. The handle identifies a particular instrument session.
Default Value: None
|
channelName |
ViChar[] |
If the attribute is channel-based, this parameter specifies the name of the channel on which to set the value of the attribute. If the attribute is not channel-based, then pass VI_NULL or an empty string.
Valid Channel Names: x1,x2,y1,y2
Default Value: ""
|
attributeID |
ViAttr |
Pass the ID of an attribute.
From the function panel window, you can use this control as follows.
- Click on the control or press <ENTER>, <spacebar>, or
<ctrl-down arrow>, to display a dialog box containing a
hierarchical list of the available attributes. Attributes
whose value cannot be set are dim. Help text is shown for
each attribute. Select an attribute by double-clicking on it
or by selecting it and then pressing <ENTER>.
Read-only attributes appear dim in the list box. If you
select a read-only attribute, an error message appears.
A ring control at the top of the dialog box allows you to see
all IVI attributes or only the attributes of the ViInt32 type.
If you choose to see all IVI attributes, the data types appear
to the right of the attribute names in the list box.
Attributes with data types other than ViInt32 are dim. If
you select an attribute data type that is dim, LabWindows/CVI
transfers you to the function panel for the corresponding
function that is consistent with the data type.
- If you want to enter a variable name, press <CTRL-T> to change
this ring control to a manual input box.
- If the attribute in this ring control has named constants as
valid values, you can view the constants by moving to the
Attribute Value control and pressing <ENTER>.
|
attributeValue |
ViInt32 |
Pass the value to which you want to set the attribute.
From the function panel window, you can use this control as follows.
- If the attribute currently showing in the Attribute ID ring
control has constants as valid values, you can view a list of
the constants by pressing <ENTER> on this control. Select a
value by double-clicking on it or by selecting it and then
pressing <ENTER>.
Note: Some of the values might not be valid depending on the
current settings of the instrument session.
Default Value: none
|
Return Value
Name |
Type |
Description |
status |
ViStatus |
Returns the status code of this operation. The status code either indicates success or describes an error or warning condition. You examine the status code from each call to an instrument driver function to determine if an error occurred.
To obtain a text description of the status code, call the pi40iv_error_message function. To obtain additional information about the error condition, call the pi40iv_GetErrorInfo function. To clear the error information from the driver, call the pi40iv_ClearErrorInfo function.
The general meaning of the status code is as follows:
Value Meaning
-------------------------------
0 Success
Positive Values Warnings
Negative Values Errors
This driver defines the following status codes:
Status Description
-------------------------------------------------
WARNINGS:
/*=CHANGE:===================================================*
Insert Instrument-defined warning codes here.
*================================================END=CHANGE=*/
ERRORS:
/*=CHANGE:===================================================*
Insert Instrument-defined error codes here.
*================================================END=CHANGE=*/
This instrument driver also returns errors and warnings defined by other sources. The following table defines the ranges of additional status codes that this driver can return. The table lists the different include files that contain the defined constants for the particular status codes:
Numeric Range (in Hex) Status Code Types
-------------------------------------------------
3FFA2000 to 3FFA3FFF IviSwtch Warnings
3FFA0000 to 3FFA1FFF IVI Warnings
3FFF0000 to 3FFFFFFF VISA Warnings
3FFC0000 to 3FFCFFFF VXIPnP Driver Warnings
BFFA2000 to BFFA3FFF IviSwtch Errors
BFFA0000 to BFFA1FFF IVI Errors
BFFF0000 to BFFFFFFF VISA Errors
BFFC0000 to BFFCFFFF VXIPnP Driver Errors
|
References
Set Attribute
Set/Get/Check Attribute
Configuration
Pickering Interfaces PXI/LXI IVI Switch
Alphabetical Function Index
Hierarchical Function Index