Click or drag to resize

Method General Editor

Name

Name of the method. Method names must start with a capital letter and can contain only alphanumeric characters.

Return type

Return type of the method. Right-click on the Return type text box to bring up a context menu of types.

Generic types are supported. For information on how to use generic types, refer to Generics (C# Programming Guide)

If an array is desired, append opening and closing square brakets ([]) to the type name. For example, to have the method return an array of double, enter Double[].

Repeated capability

The repeated capability with which the method is associated.

Note Note

Not all repeated capabilites defined for the driver may appear in the Repeated capability combo box. This is because not all repeated capability transitions may be valid for the selected method. For instance, a method located on a collection-style repeated capability is inherently associated with that repeated capability based on its location within the driver hierarchy. Thus, it cannot be associated with a completely different repeated capability by using the Repeated capability combo box.

Implementation

Choosing the Manual option requires the driver developer to provide the method implementation. This choice is often used for methods that rely upon non-message-based device communications, such as register-based devices or drivers that rely upon a support DLL.

Choosing the Instrument command option instructs Nimbus to automatically generate all of the implementation code needed to send the specified command and to read a response if the Response text box is non-empty.

Choosing the Manual with instrument command option is the same as Manual except that the Command and Response textboxes are enabled and used to populate the Instrument Command section of the driver help page for the method. This is useful for methods that require manual implementation but that ultimately rely upon an instrument command in their manually added code.

Command

Specifies the command to send to the device. Nimbus supports a rich command and responseformatting syntax, which can include the parameters, repeated capabilities, and more. Please see the topic Working With Instrument Commands for a detailed discussion of automatic command formatting.

Response

Specifies the format of the response to read back from the device. Nimbus supports a rich command formatting syntax, which can include the parameters, repeated capabilities, and more. Please see the topic Working With Instrument Commands for a detailed discussion of automatic command formatting.

If no response is specified, Nimbus will only send the command specified in the Command text box -- no response will be read from the device.

Allow null for any reference-type parameter

By default, the Nimbus Code Weaver will automatically generate parameter validation code that raises a NullReferenceException if null is passed for any reference-type parameters to this method. Checking this box causes Nimbus to decorate this method with a NullAllowed attribute, which suppresses the standard null reference check for all reference-type parameters to this method.

Model-Specific Programming with the Models Window

The Method General Editor contains a collapsible Models Window in the right portion of the editor. This window is used for two purposes:

  • Specifying that a model or group of models does not support the method.

  • Customizing settings on a per-model or per-family basis.

Note Note

The Models Window cannot be used to define new models for the driver. The list of models supported by the driver is specified on the Models Page of the Driver Settings Editor.

The root node of the Models Window is labeled "All Models". This node can be thought of as the "default behavior" for the method. By default, all instrument models are supported for the method and all share the same command and response. Thus, the editor controls are initially only enabled when "All Models" is selected in the Models Window. This changes when model-specific behavior is specified, as explained below.

When you use the Models Window to specify that a method is not supported for a model, Nimbus will generate the necessary code to raise the IVI-defined OperationNotSupportedException exception.

To specify that a particular model is not supported

  1. From the Models Window, right-click on the desired model or family.

  2. Choose Remove model support.

  3. The selected model name appears with a strikethrough font.

    Note that if a family was selected, all models in the family appear with a strikethrough font, indicating that the OperationNotSupportedException exception will be raised for those models as well.

  4. To re-enable support for a model, right-click the model and choose Add model support.

When customizing behavior on a per-model or per-family basis, Nimbus generates code that will send a different command and/or read a differently formatted response, based upon the actual model detected at runtime. See the discussion of the InitializeIdentification function to understand how Nimbus determines the connected model at runtime.

Only the instrument command and instrument response can be customized on a per-model basis. The return data type, repeated capability, and implementation style are all static characteristics of the method and cannot be changed dynamically based on the connected instrument model.

To customize the command or response for a model

  1. From the Models Window, right-click on the desired model or family.

  2. Choose Customize settings

  3. The Command and Reponse text boxes are enabled for the selected model, allowing model-specific values to be set. The model appears in bold font for the customized model.

    Note that if a family was selected, all models in the family appear in bold font, indicating that they will all share a custom command and/or resposne.

  4. To have a method return to using the default command and response for a model, right-click the model and choose Remove custom settings. The model appears in normal font and the editor controls are once again disabled when the model is selected, indicating that the model is controlled via the default settings specified when the "All Models" node is selected.

See Also

Download a complete CHM version of this documentation here.