Click or drag to resize

Adding an Enumeration

To add an enum to a driver

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

  2. The IVI.NET Driver Designer tree view opens.

  3. Expand the root node, which will be named after the driver assembly (e.g.: Acme.Acme4321).

  4. Right-click on the Enums node and select 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.

    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, and must start with an alphabetic character.

    • Spaces are not allowed.

  7. The new enum will be defined in Enums.cs.

    After the enum is added, the Enum General Editor appears in the right portion of the IVI.NET Driver Designer.

  8. If an IVI-C driver is currently linked to the IVI.NET driver via the IVI-C Page of the Driver Settings Editor, time and linked to the IVI.NET enum.

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

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

Tip Tip

Use the Info Panel in the lower portion of the IVI.NET Driver 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 IVI.NET 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 IVI.NET Driver Designer.

  6. If an IVI-C driver is currently linked to the IVI.NET driver via the IVI-C Page of the Driver Settings Editor, then an IVI-C enum member is automatically created at this time and linked to the IVI.NET member.

    To view the linked IVI-C enum member, right-click the IVI.NET method, and choose Go to IVI-C Enum Member.

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

    For a detailed discussion of the associations between IVI.NET methods and IVI-C functions, see the topics Managing IVI-C Driver Functionality and Linking IVI.NET and IVI-C Methods and Properties.

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.