niDMM_SetAttributeViString

NI-DMM C/CVI/VB

niDMM_SetAttributeViString

ViStatus = niDMM_SetAttributeViString(ViSession Instrument_Handle, ViConstString Channel_Name, ViAttr Attribute_ID, ViString Attribute_Value[])

Purpose

This function sets the value of a ViString 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
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.
Attribute_Value ViString Pass the value that you want to set the attribute to.

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.