Using the Development Mode Settings for Inherent Attributes

National Instruments IVI Driver

Using the Development Mode Settings for Inherent Attributes

IVI class drivers have many features that help you to debug and analyze your program. You enable these features by setting the development mode settings for inherent attributes.

After you complete the development of your application and verify that your program is working correctly, enable the production mode settings for the inherent attributes to maximize performance.

The following table lists the development mode and production mode settings for the inherent attributes.

Development Mode and Production Mode Settings for Inherent Attributes

LabVIEW Property Inherent Attribute Development Mode Setting Production Mode Setting
ClassPrefix Spy CLASSPREFIX_ATTR_SPY VI_TRUE VI_FALSE
ClassPrefix Range Check CLASSPREFIX_ATTR_RANGE_CHECK VI_TRUE VI_FALSE
ClassPrefix Query Instrument Status CLASSPREFIX_ATTR_QUERY_INSTRUMENT_STATUS VI_TRUE VI_FALSE
ClassPrefix Interchange Check CLASSPREFIX_ATTR_INTERCHANGE_CHECK VI_TRUE VI_FALSE
ClassPrefix Record Value Coercions CLASSPREFIX_ATTR_RECORD_COERCIONS VI_TRUE VI_FALSE

Refer to Measurement & Automation Explorer Help for IVI for information about how to use MAX to set the development mode and production mode settings for inherent attributes.

CLASSPREFIX_ATTR_RANGE_CHECK

Enables/disables range checking. If you enable range checking, the specific driver checks all parameters passed to the class driver and specific driver functions.

CLASSPREFIX_ATTR_QUERY_INSTRUMENT_STATUS

Enables/disables instrument status checking. If you enable instrument status checking, the specific driver checks the status of the instrument after most calls made to the class driver or specific driver.

CLASSPREFIX_ATTR_INTERCHANGE_CHECK

Enables/disables interchangeability checking. Interchangeability checking verifies that your program produces the same behavior when you use it with a different instrument. If you enable interchangeability checking, the driver queues warnings when it encounters instrument configurations that are not likely to produce the same behavior when you use a different instrument. The class driver obtains interchangeability warnings from the specific driver, so you can find additional documentation on the warnings provided in the specific driver's help file.

NoteYou can use NI Spy to view interchangeability warnings. NI Spy highlights driver functions that report interchangeability warnings in blue. If you do not have NI Spy, you can use the PREFIX_GetNextInterchangeWarning function to retrieve interchangeability warnings programmatically.
CLASSPREFIX_ATTR_RECORD_COERCIONS

Enables/disables coercion recording. In many cases, specific drivers coerce the value that you specified for a function parameter or attribute to a value that the instrument can accept. Specific drivers may coerce a value only if the new value results in instrument behavior that is the same or better than what you requested. Coercion of values is essential for instrument interchangeability. If specific drivers did not coerce values, you would have to specify valid values for the specific instruments you use. If you attempted to use your program with new instruments, the valid values would probably be different.

For example, the IviDmm class defines an attribute called IVIDMM_ATTR_RANGE that you use to specify the measurement range. Typically, DMMs have a discrete set of ranges. One DMM might have discrete settings for the range attribute such as 1 V, 10 V, and 100 V. Another DMM might have discrete settings such as 2 V, 20 V, and 200 V. If you use the first instrument, you might set the range attribute to 10.0. If you then attempt to run your program with the second instrument, 10.0 is no longer an acceptable value, so the specific driver for the second instrument therefore coerces the value to 20.0.

In other cases, specific drivers coerce the value you specified for an attribute to the value the instrument would coerce the value to. This coercion is necessary to implement the IVI state caching feature. For example, if a DMM has discrete settings for the range attribute of 1 V, 10 V, and 100 V, it coerces any value between 2 V and 9 V to 10 V. Thus, if you set the range to 2 V, then to 7 V, and then to 5 V, the actual range remains at 10 V. To prevent sending redundant commands to the instrument, the specific driver coerces the value internally, sends the coerced value to the instrument, and caches the coerced value. In this example, the specific driver coerces 2 V to 10 V, sends 10 V to the instrument, and caches 10 V. When you set the range to 5 V and 7 V, the driver coerces these values to 10 V, notices that 10 V is the current cache value, and does not send any commands to the instrument.

If you enable coercion recording, the driver keeps a record of each instance a ViInt32 or ViReal64 value is coerced. You can view the coercion records to understand how the specific driver coerces values that you specified in your program.

NoteYou can use NI Spy to view the coercion information. If you do not have NI Spy, you can use the PREFIX_GetNextCoercionRecord function to retrieve the coercion information programmatically.