Interchangeability Checking Rules

National Instruments IVI Driver

Interchangeability Checking Rules

Note  Although interchangeability checking can be performed through the specific driver interface, interchangeability and thus interchangeability checking is only relevant when called through the class driver interface.

The following rules govern interchangeability checking in IVI.

  1. An interchangeability check occurs when you invoke a driver operation that depends on the current state of the instrument. For example, IviDmm compliant drivers perform interchangeability checking when your program calls any of the functions shown in the following table.

    IviDmm Functions that Invoke Interchangeability Checking

    Name in LabWindows/CVI Name in LabVIEW
    Prefix_Initiate Prefix Initiate
    Prefix_Read Prefix Read
    Prefix_ReadMultiPoint Prefix Read MultiPoint
  2. The driver performs interchangeability checking on a capability group basis. When you enable interchangeability checking, the driver always performs interchangeability checking on the base capabilities group.
  3. The driver performs interchangeability checking on all extension groups for which you have set any of the attributes. If your program has never set any attributes of an extension group, the driver does not perform interchangeability checking on that group.

In general, a driver generates an interchangeability warning when it encounters one of the following conditions:

  • Unspecified State—An attribute that is in a state that you did not specify. An attribute ends up in an unspecified state if the attribute is not configured by your program or if your program configures the attribute but the value becomes invalid as a result of your program configuring a different attribute.

    If an attribute is in a state that you did not specify, then the value of the attribute is unknown. The value of the attribute, and therefore the behavior of the instrument, is likely to be different when you run the program with a different instrument.

  • Instrument Specific Value—You set a class–defined attribute to an instrument specific value. Many class attribute values represent a set of discrete settings. For these attributes, the class specifications defines the possible values that you can assign to the attribute. Specific drivers can define additional, instrument specific values for the attribute. When your program sets an attribute to an instrument specific value, your program is likely to behave differently when you run it with different instruments.

    For example, the attribute that configures the measurement function can have both class values and instrument specific values. The class defines values for common measurement functions such as AC volts, DC volts, AC current, DC current, and others. Specific drivers can define instrument specific values for the attribute. The constant values that one specific driver uses can overlap with the constant values other specific drivers use. One specific driver might define an instrument specific measurement function and another specific driver might use the same value to define an entirely different measurement function. Therefore, using an instrument specific value in your program can result in different measurement results depending on which instrument you use.

  • Read–Only Attribute—You configure the value of an attribute that the class defines as read–only. In a few cases, the class defines read-only attributes that specific drivers might implement as read/write.

    The attributes that return the aperture time in the IviDmm class are examples of this interchangeability issue. With some DMMs, you can set the aperture time as well as read it. The specific drivers for these DMMs might implement the attributes for the aperture time as read/write. Most other class-compliant drivers implement the attribute as read–only. Therefore, if your program sets an attribute that a class defines as read–only, your program may not work with other instruments.

  • Value Not Configured—The driver encounters an error when it tries to apply a value to an extension attribute that your program never configures. Disabling Unused Extensions describes how the driver sets the attributes of extension groups that do not have specified values—it sets the attributes to an interchangeable state. The driver does this to make your program behave the same regardless of whether the instruments you use implement the extension group. Other instruments that implement the extension group might not support the value to which the driver attempts to set the attribute. In this case, the driver queues an interchangeability warning instead of returning an error from the function.

    An example of this behavior is the attribute that configures the interpolation method in the IviScope class. If your program does not set the value of this attribute and the specific driver implements the attribute, the driver attempts to set the interpolation method to Sin(x)/x. However, some oscilloscopes always interpolate data points. For these cases, the driver generates an interchangeability warning to indicate that the attribute that controls the interpolation method is not in an interchangeable state.

    Each IVI specific driver defines exceptions to the interchangeability checking rules and defines which functions perform interchangeability checking. Refer to IVI Class Driver Help for more information regarding the interchangeability checking rules for a particular class.