niRFSA_GetAttributeViString
- Updated2025-02-03
- 2 minute(s) read
niRFSA_GetAttributeViString
ViStatus niRFSA_GetAttributeViString(ViSession vi, ViConstString channelName, ViAttr attributeId, ViInt32 bufsize, ViChar value[]);
Purpose
Queries the value of a ViString attribute.
You can use this low-level function to get the values of inherent IVI attributes and instrument-specific attributes.
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 bufSize parameter. If the current value of the attribute, including the terminating NULL byte, is larger than the size you indicate in the bufSize parameter, the function copies buffer size – 1 bytes into the buffer, places an ASCII NULL 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 bufSize and VI_NULL for the attributeValue buffer.
Supported Devices: PXI-5600, PXIe-5601/5603/5605/5606 (external digitizer mode), PXIe-5644/5645/5646, PXI-5661, PXIe-5663/5663E/5665/5667/5668, PXIe-5693/5694/5698, PXIe-5820/5830/5831/5832/5840/5841/5842/5860
Parameters
Input | ||
Name | Type | Description |
vi | ViSession | Identifies your instrument session. vi is obtained from the niRFSA_init or niRFSA_InitWithOptions function. |
channelName | ViConstString | Specifies the name of the channel on which to check the attribute value if the attribute is channel based. If the attribute is not channel based, set this parameter to "" (empty string) or VI_NULL. |
attributeId | ViAttr | Pass the ID of an attribute. |
bufSize | ViInt32 | Pass the number of bytes in the ViChar buffer you specify for the attribute value parameter. If you pass 0, you can pass VI_NULL for the attribute value buffer parameter. |
Output | ||
Name | Type | Description |
value | 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 bufSize. If you specify 0 for the bufSize parameter, you can pass VI_NULL for this parameter. |
Return Value
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. To obtain a text description of the status code, call the niRFSA_error_message function. To obtain additional information about the error condition, call the niRFSA_GetError function. To clear the error information from the driver, call the niRFSA_ClearError function. The general meaning of the status code is as follows:
|