Click or drag to resize

Adding an Enumeration

To add an IVI-COM enum 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 Enums node and choose Add Enum.

  5. A new enum is added with a default name and the tree node enters edit mode.

  6. With the enum node still in edit mode, type the desired name of the enum and hit the Enter key.

    Note Note

    By convention, enum names start with the project name and end with Enum. However, when typing an enum name in the tree view, a shortened form of the name can be used. The project name prefix and the Enum suffix can be excluded. For example, if the desired enum is Acme4321TriggerSourceEnum, then type only TriggerSource and the full enum name will be expanded when the Enter key is pressed.

    When choosing an enum name, the following naming rules apply:

    • The name must be unique within the driver.

    • The name must contain only alphanumeric characters.

    • Spaces are not allowed.

  7. After the enum is added, the IVI-COM Enum 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 enum further.

  8. If IVI-C wrapper generation is enabled on the IVI-C Page of the Driver Settings Editor, then an IVI-C enum is automatically created at this time and associated with the IVI-COM enum.

    To view the linked IVI-C enum, right-click the IVI-COM enum, and choose Go to IVI-C Enum.

    To remove the linked IVI-C enum, thereby creating an IVI-COM-only enum, right-click the IVI-COM enum, and choose Delete IVI-C Enum.

Tip Tip

Use the Info Panel in the lower portion of the IVI-COM Designer to view and navigate to methods and properties that use the enum.

To add an enum member to an enum

  1. Locate the enum to be modified under the Enums node in the Driver Designer

  2. Right click on the enum name and select Add Enum Member.

  3. A new enum member is added with a default name and the tree node enters edit mode.

  4. With the enum member node still in edit mode, type the desired name of the enum member and hit the Enter key.

    When choosing an enum member name, the following naming rules apply:

    • The member name must be unique within the enum being modified.

    • The name must contain only alphanumeric characters, and must start with an alphabetic character.

    • Spaces are not allowed.

    Tip Tip

    The enum member value can be entered in either hexadecimal or decimal format. It will be converted to the format configured for that enum. Right-click on the parent enum to see a context menu which enables or disables hexadecimal display mode.

  5. After the enum member is added, the Enum Member Editor appears in the right portion of the Driver Designer.

Shorthand notation for defining enums

Nimbus supports a convenient shorthand notation for defining enums. The enum and its members can be defined all at once when the enum is initially added.

After executing the Add Enum command, and while still in edit mode, the following text can be used to define a TriggerSource enum with members Internal, External, and Software.

TriggerSource; Internal, External, Software

In the above, the enum name TriggerSource is specified first, followed by a semicolon to delineate it from the enum member specifications. Enum members follow and are separated by commas.

This shorthand notation can also be used to define the enum member values, as in the following:

TriggerSource; Internal = 2, External = 0x15, Software = 47

Note that when assigning enum member values, either hex format or decimal format may be used.

Once an enum is defined, additional enum members can be added using this same shorthand notation, except that the enum name is excluded. After executing the Add Enum Member command, and while still in edit mode, the following text can be used to add a series of TTL trigger source lines to the existing TriggerSource enum from the above example:

TTL0, TTL1 = 5, TTL2 = 6, TTL3, TTL4, TTL5 = 0x14, TTL6, TTL7

Download a complete CHM version of this documentation here.