ViStatus pi40iv_GetAttributeViString (ViSession instrumentHandle, ViChar _VI_FAR channelName[], ViAttr attributeID, ViInt32 bufferSize, ViChar _VI_FAR attributeValue[]);
This function queries the value of a ViString attribute.
You can use this function to get 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.
You must provide a ViChar array to serve as a buffer for the value. You pass the number of bytes in the buffer as the Buffer Size parameter. If the current value of the attribute, including the terminating NUL byte, is larger than the size you indicate in the Buffer Size parameter, the function copies Buffer Size - 1 bytes into the buffer, places an ASCII NUL byte at the end of the buffer, and returns the buffer size you must pass to get the entire value. For example, if the value is "123456" and the Buffer Size is 4, the function places "123" into the buffer and returns 7.
If you want to call this function just to get the required buffer size, you can pass 0 for the Buffer Size and VI_NULL for the Attribute Value buffer.
If you want the function to fill in the buffer regardless of the number of bytes in the value, pass a negative number for the Buffer Size parameter.
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.
|
channelName | ViChar[] |
If the attribute is channel-based, this parameter specifies the name of the channel on which to obtain the value of the attribute. If the attribute is not channel-based, then pass VI_NULL or an empty string.
|
attributeID | ViAttr |
Pass the ID of an attribute.
|
bufferSize | ViInt32 |
Pass the number of bytes in the ViChar array you specify for the Attribute Value parameter.
|
Output | ||
Name | Type | Description |
attributeValue | ViChar[] |
The buffer in which the function returns the current value of the attribute. The buffer must be of type ViChar and have at least as many bytes as indicated in the Buffer Size parameter.
|
Name | Type | Description |
statusOrRequiredSize | 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.
|
Get Attribute
Set/Get/Check Attribute
Configuration
Pickering Interfaces PXI/LXI IVI Switch
Alphabetical Function Index
Hierarchical Function Index