niDMM_GetAttributeViString

NI-DMM C/CVI/VB

niDMM_GetAttributeViString

ViStatus = niDMM_GetAttributeViString(ViSession Instrument_Handle, ViConstString Channel_Name, ViAttr Attribute_ID, ViInt32 Buffer_Size, ViChar Attribute_Value[])

Purpose

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 Array Size parameter.

Parameters

Input
Name Type Description
Instrument_Handle ViSession Identifies a particular instrument session. You obtain the Instrument_Handle parameter from niDMM_init or niDMM_InitWithOptions. The default is None.
Channel_Name ViConstString This parameter is ignored. National Instruments DMMs do not support channel names since they only have a single channel. This parameter is included in order to support interchangeability and upgradability to multiple channel DMMs.

The default value is " " (an empty string).

Attribute_ID ViAttr Pass the ID of an attribute.
Buffer_Size ViInt32 Pass the number of bytes in the ViChar array you specify for the Attribute_Value parameter.

If the current value of the attribute, including the terminating NULL byte, contains more bytes that you indicate in this 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 pass a negative number, the function copies the value to the buffer regardless of the number of bytes in the value. If you pass 0, you can pass VI_NULL for the Attribute_Value buffer parameter.

Output
Name Type Description
Attribute_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 the Buffer_Size parameter.

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

Return Value

Name Type Description
Status ViStatus Reports the Status of this operation. To obtain a text description of the status code, call niDMM_error_message. To obtain additional information concerning the error condition, use niDMM_GetError.