Click or drag to resize

Adding a Property

Before adding a property to a driver design, it is useful to consider if the capability might better be exposed from the driver as a method. The topic Properties vs. Methods provides a few guidelines on choosing between exposing driver capabilities as methods versus exposing them as properties.

To add an IVI-COM property to a driver

  1. From Solution Explorer, double-click the Driver Designer node under the Nimbus node.

  2. The Driver Designer opens as a tabbed document window. Select the IVI-COM tab.

  3. From the tree view expand the type library node for the instrument-specific hierarchy. This node is named "<driverName>Lib".

  4. Right-click on the desired location within the hierarchy and choose Add Property.

  5. A new property is added with a default name and the tree node enters edit mode. By default the property type is Double

  6. With the property node still in edit mode, type the desired name of the property followed by a colon (:) followed by the name of the return type, and hit the Enter key. The colon and type can be excluded if the desired property type is Double.

    Any of the following data types may be entered as a property type:

    • Boolean

    • String

    • Byte

    • Int16

    • Int32

    • Int64

    • Single

    • Double

    • Any enum defined in the type library.

    Tip Tip

    When typing an enum as the property type, a shortened form of the enum name can be used. The project name prefix and the Enum suffix can be excluded. For example, if the desired property type is Acme4321TriggerSourceEnum, then type only TriggerSource and the full enum name will be expanded when the Enter key is pressed.

    Note Note

    As per the IVI specifications, array properties are not allowed. All properties must read or write a single, scalar value.

    When choosing a property name, the following naming rules apply:

    • The name must be unique within its parent interface. It need not be unique across the entire driver.

    • The name must contain only alphanumeric characters.

    • Spaces are not allowed.

    • The name must begin with a capital letter.

    If a property type is not entered, Nimbus will automatically try to infer the property type from the name. The table below shows what property types are inferred from property names. If the property name does not match a condition in the table, then it will use the default Double property type.

    Property Name

    Data Type

    Ends with Enable or Enabled.

    Boolean

    Ends with Count, Length or Number.

    Int32

    Starts with Num.

    Int32

    Ends with Name or Text.

    String

  7. After the property is added, the IVI-COM Property General Editor appears in the right portion of the IVI-COM Designer. See the help topic for that Item Editor for details on defining the property further.

  8. Once a property has been added, parameters can be added to the property. See the topic Adding a Parameter for details on adding parameters.

  9. If IVI-C wrapper generation is enabled on the IVI-C Page of the Driver Settings Editor, then an IVI-C attribute is automatically created at this time and linked to the IVI-COM property.

    To view the linked IVI-C attribute, right-click the IVI-COM property, and choose Go to IVI-C Attribute.

    To remove the linked IVI-C attribute, thereby creating an IVI-COM-only property, right-click the IVI-COM property, and choose Delete IVI-C Attribute.

    For a detailed discussion of the associations between IVI-COM properties and IVI-C attributes, see the topics Managing IVI-C Driver Functionality and Linking IVI-COM and IVI-C Methods and Properties.

See Also

Download a complete CHM version of this documentation here.