Queries the value of a ViString attribute.

Syntax

ViStatus __stdcall niRFSG_GetAttributeViString(ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 bufSize, ViChar value[])

Remarks

Use this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific 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 ViString (ViChar array) to serve as a buffer for the value. Pass the number of bytes in the buffer as the Buffer Size parameter. If the current value of the attribute, including the terminating NULL 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 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.

To call this function to get only the required buffer size, pass 0 for the buffer size and VI_NULL for the attribute value buffer.

Parameters

NameDirectionTypeDescription
vi[in]ViSession

Identifies your instrument session. The ViSession handle is obtained from the niRFSG_Init function or the niRFSG_InitWithOptions function and identifies a particular instrument session.

channelName[in]ViConstString

Specifies the waveform name and the marker name.

Example:

"waveform::waveform0/marker0"

attribute[in]ViAttr

Pass the ID of an attribute.

bufSize[in]ViInt32

Pass the number of bytes in the ViChar buffer you specify for the waveformNames parameter.

If you pass 0, you can pass VI_NULL for the waveformNames parameter.

value[out]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 bufferSize parameter.

If you specify 0 for the bufferSize parameter, you can pass VI_NULL for this parameter.

Returns

gets the status code of this operation. The status code either indicates success or describes an error or warning condition. 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 error code, call the niRFSG_GetError function. The general meaning of the status code is as follows:

Value

Meaning

0

Success

Positive Values

Warnings

Negative Values

Errors