Name of the method. Method names must start with a capital letter and can contain only alphanumeric characters.
Method General Editor
Name
Return type
Return type of the method.
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 brackets ([]) 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.
Target frameworks
Specifies the target frameworks supported by the method. Typically, this will be set to Inherited, which indicates that the method supports the same target frameworks as the parent class. However, you can override this setting to specify a minimum target framework or a specific set of target frameworks. Nimbus will update the driver code accordingly with #if statements to selectively include or exclude code based on the target framework.
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 response 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.
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, Nimbus 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
Section titled “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.
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
Section titled “To specify that a particular model is not supported”-
From the Models Window, right-click on the desired model or family.
-
Choose Remove model support.
-
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
OperationNotSupportedExceptionexception will be raised for those models as well. -
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.
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
Section titled “To customize the command or response for a model”-
From the Models Window, right-click on the desired model or family.
-
Choose Customize settings
-
The Command and Response 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 response.
-
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.