NI-SCOPE C Function Reference

niScope_SetAttributeViSession

  • Updated2023-02-21
  • 2 minute(s) read

C Function Prototype

ViStatus niScope_SetAttributeViSession (ViSession vi, ViConstString channelList, ViAttr attributeID, ViSession value);

Purpose

Sets the value of a ViSession 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.
Note  NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible because they handle order dependencies and multithread locking for you. In addition, the high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute 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
vi ViSession The instrument handle you obtain from niScope_init that identifies a particular instrument session.
channelList ViConstString The channel to configure. For more information, refer to Channel String Syntax.
attributeID ViAttr The ID of an attribute.
value ViSession The value that you want to set the attribute to. Some values might not be valid depending on the current settings of the instrument session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call niScope_GetErrorMessage. To obtain additional information concerning the error condition, use niScope_GetError and niScope_ClearError. The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors