Click or drag to resize

Adding a Parameter

Parameters can be added to a method or a property. There are some special considerations when choosing between adding an Output parameter or an Input/Output parameter. You should review the topic Understanding Parameter Direction before choosing between these two options.

To add a parameter to a method or a property

  1. Right-click on the method or property in the IVI-COM Designer tree view and choose Add Parameter.

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

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

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

    • Boolean

    • String

    • Byte

    • Int16

    • Int32

    • Int64

    • Single

    • Double

    • Any enum defined in the type library.

    • An array of any of the above -- designated by appending opening and closing square brackets ([]) to the type name.

      Example: Enter double[] for an array of double-precision floating-pointer numbers.

    Tip Tip

    When typing an enum as the parameter 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 parameter type is Acme4321TriggerSourceEnum, then type only TriggerSource and the full enum name will be expanded when the Enter key is pressed.

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

    • The name must be unique within its parent method.

    • The name must contain only alphanumeric characters.

    • Spaces are not allowed.

    • The name must begin with a capital letter.

  4. After the parameter is added, the IVI-COM Parameter 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 method further.

  5. If IVI-C wrapper generation is enabled on the IVI-C Page of the Driver Settings Editor, then an IVI-C parameter is automatically created at this time and linked to the IVI-COM parameter. For array parameters, Nimbus automatically generates an extra IVI-C buffer size parameter to indicate the size of the array on input. If the array is an Output or Input/Output, Nimbus also generates an IVI-C actual size parameter to indicate the size of the array returned from the driver method.

    To view the linked IVI-C parameter, navigate to the parent method or property, right-click the IVI-COM method, and choose Go to IVI-C Function.

    For a detailed discussion of the associations between IVI-COM methods and IVI-C functions, 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.