Adding and Editing Instrument Attributes
Add and edit instrument driver attributes in the Edit Attribute dialog box, which appears in the following figure.

When you apply changes, the Attribute Editor saves this information into the .c, .h, and .sub files for the instrument driver.
Click the Add Attribute or Edit button to open the Edit Attribute dialog box, which contains the following options.
- Constant Name—Specifies the defined constant name of the attribute. All attribute constant names must begin with PREFIX_ATTR_, where PREFIX is the instrument prefix. Enter the rest of the name in this control.
- Descriptive Name—Specifies the name for the attribute in the Select Attribute Constant dialog box that users can invoke in the Get/Set/CheckAttribute function panels.
- Data Type—Lets you select the data type of the attribute. The data type can be ViInt32, ViInt64, ViReal64, ViString, ViBoolean, ViSession, and ViAddr. You can use ViAddr only for attributes that you mark as hidden from the instrument driver user. You can hide an attribute from the instrument driver user by adding checkmarks to the IVI_VAL_NOT_USER_READABLE and IVI_VAL_NOT_USER_WRITABLE flags. If these two flags are set when you click OK, the Attribute Editor converts them to the IVI_VAL_HIDDEN macro in source code.
- Range Table—Allows you to select a static range table for the attribute. You can select an existing range table in the ring control. If you do not want a range table, select None in the ring control. The Range Table ring control is enabled only for ViInt32, ViInt64, and ViReal64 attributes. When you select a range table, the attribute data type must match the data type that appears in the Edit Range Table dialog box.
- Edit—Invokes the Edit Range Table dialog box for the range table that currently appears in the Range Table ring control. When None is in the Range Table ring control, the button label changes to New. The New button opens the Edit Range Table dialog box for a new range table.
- Default Value—Specifies the default value for the attribute. The IVI Engine uses the default value only when simulation is enabled. You obtain the value of the attribute before you set it. The default value represents a simulated initial value for the attribute. In the Default Value control, enter a valid C expression that is appropriate to the attribute data type.
- Compare Precision—Allows you to specify the number of digits of precision to use when comparing a cache value that the IVI Engine obtained from the instrument against a value you want to set this attribute to. The number of digits of precision can be from 1 to 14. If you specify zero, the IVI Engine uses the default, that is 14. The Compare Precision control is a string control that allows you to enter a defined constant for this value. This control applies only to ViReal64 attributes.
- Repeated—Specifies whether the attribute has a separate value for each instance of a repeated capability, such as channels. If you want the attribute to have only one value, leave this button unchecked.
- Repeated Capability—Specifies the name of the repeated capability for which you want the attribute to have separate values. For example, if you want the attribute to have a separate value for each channel, enter the string "Channel."
- Description—Specifies the help text that the .sub file stores for the attribute. Instrument driver users view the help text in the Select Attribute Constant dialog box that they invoke in the Get/Set/CheckAttribute function panels. Hidden attributes do not need help.
- Callbacks—Lists the types of attribute callback functions. You can dissociate a callback function from an attribute by removing the checkmark. Click the checkmark to remove it. Click next to an attribute to place a checkmark next to it and associate a callback function with the attribute. When you click OK, the Attribute Editor inserts skeleton code for the new callback function into the source file and associates the new callback function name with the attribute.
- Edit Name—Opens the Edit Callback Name dialog box for the callback selected in the Callbacks list window. Specify custom names for the attribute callback functions in this dialog box. The Instrument Driver Development Wizard constructs default names for attribute functions. The Attribute Editor constructs default names when you enable a callback function for an attribute in the Edit Driver Attributes dialog box. Use Edit Name if you do not want the default name. To restore the default name, remove the checkmark next to the name by clicking the checkmark. Click again to place a checkmark next to the name. Removing and then adding the checkmark again restores the default name.
- Flags—Lists the flags that you can set for the attribute. Set a flag by adding a checkmark next to its name. To hide an attribute from the instrument driver user, click checkmarks to the IVI_VAL_NOT_USER_READABLE and IVI_VAL_NOT_USER_WRITABLE flags. If these two flags are set when you apply changes, the Attribute Editor converts them to the IVI_VAL_HIDDEN macro in the source code.
- Attributes to Invalidate When Value Changes—Lists all the other instrument driver attributes. Add a checkmark next to the attributes whose cache values you want the IVI Engine to invalidate when you change the value of the attribute you are currently editing. The Attribute Editor generates a call to Ivi_AddAttributeInvalidation for each checkmarked attribute. Refer to the IVI State Caching Mechanism section for information about attribute cache value invalidation.
- On All/Same Instances—Allows you to specify whether an attribute invalidation occurs on all instances or on only the instance of the attribute you are currently editing. Click the button to toggle between the On All Instances and On Same Instance state. If the item you select in the Attributes to Invalidate When Value Changes list box has a checkmark, the (All) or (Same) tag appears at the end of the item label. If the item you select does not have a checkmark, the toggle button is dim. This option has no effect unless the attribute you are editing and the attribute it invalidates are both channel-based.
- Help—Launches the LabWindows/CVI Help.