Completely Specifying the State of the Instrument
To maximize interchangeability, you must completely specify the state of the attributes that affect the behavior of the instrument. If you do not, the behavior of your program depends on instrument specific settings that can result from any of the following conditions:
- The power-on settings of the device.
- The state that the instrument configures for an attribute as a result of your program configuring other attributes.
- The state that a previous program configured for the instrument.
If you do not specify the state of the instrument completely, you considerably increase the chance that your program will not behave the same way when you swap instruments or you run your programs in a different order.
In general, after you access a particular capability group, you must configure all attributes of that capability group that affect the behavior of the instrument. Because all specific drivers that are compliant with a class implement the base capability group, you must completely specify that state of the base capabilities. After you access a particular extension capability group, you must configure all attributes of that extension group. Normally, you configure the attributes through one or more high-level configuration functions.
Note Not all attributes of a particular capability group affect the behavior of the instrument. In some cases, if one attribute is set to a particular value, a second attribute no longer affects the behavior of the instrument. In such cases, you do not have to specify the state of the second attribute. However, NI recommends that you specify the state of all attributes within the capability groups that you use for the sake of long-term stability and reuse. For example, if you set the IVIDMM_ATTR_SAMPLE_COUNT to 1, you do not need to specify the values of the IVIDMM_ATTR_SAMPLE_TRIGGER and IVIDMM_ATTR_SAMPLE_INTERVAL attributes because these attributes do not affect the behavior of the instrument. Similarly, if you do not set the SAMPLE_TRIGGER to IVIDMM_VAL_INTERVAL, you do not need to specify the value of the IVIDMM_ATTR_SAMPLE_INTERVAL attribute. |