Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

.NET Module Tab

NI TestStand™ 4.0 Help
April 2007

NI Part Number:
370052F-01

»View Product Info

To display the .NET Module tab in the TestStand Sequence Editor, insert a step configured to use the .NET Adapter and select Specify Module or Step Settings from the context menu. The .NET Module tab contains the following options:

  • Assembly—Specifies the path and name of the assembly that the step calls.
    • Browse for Assembly—Selects an assembly.
    • Browse the GAC—Selects an assembly that is registered with the system. For assembly files, you can specify an absolute or relative pathname. Relative pathnames are relative to the TestStand search directory paths. To customize the TestStand search directory paths, select Configure»Search Directories. For assembly files, the ring control contains an MRU list of the last five assemblies selected.

      If you want the .NET Adapter to refresh the list of global assemblies, click Refresh. This list also refreshes when you select File»Unload All Modules. Clicking Refresh also instructs the .NET Adapter to reload the information about classes, methods, and properties in the selected assembly.
      Note  The .NET Adapter cannot unload .NET code module assemblies if Microsoft Visual Studio is debugging managed code in the TestStand process.
    • .NET Source Code Files—Launches the .NET Source Code Files window, in which you can specify the pathname for the source file, project file, and solution file for Visual Studio that implements the function the module calls. You must install Measurement Studio Enterprise Edition to use this feature.
  • Object Reference—Specifies a variable or property of type object reference. When a step creates an object, the .NET Adapter assigns the reference to the variable or property, if specified. Otherwise, the .NET Adapter automatically releases the reference after executing the step. If the step does not create an object, but instead calls a non-static method or accesses a property, this control must contain the value of a valid object reference that refers to the object on which to call the method or access the property. For static methods and properties, the .NET Adapter ignores this control. Click the Expression Browse button to launch the Expression Browser dialog box. Click the Create Type from Struct button to create a named data type that contains properties for each element in the struct selected in the Class control.

    If the step operates on a struct instead of an object, you can specify a variable or property of type object reference, or a named data type that contains properties for each element in the struct selected in the Class control. If you specify a named data type and the step creates the struct, the .NET Adapter calls a constructor for the struct to initialize its elements. If you specify a named data type and the step does not create the struct, the .NET Adapter automatically creates a temporary struct and assigns the values in the TestStand named data type to the struct elements. After executing the step, the .NET Adapter assigns the struct element values back to the TestStand named data type.
    Note  When TestStand releases a .NET object, the .NET Common Language Runtime (CLR) makes the object available for garbage collection, so the object might not be disposed of immediately. If the object implements the IDisposable interface, use the Call Dispose on Release of Object option on the Configure Class Constructor window to immediately garbage collect the object.
  • Class—Specifies the name of the class that the step operates on. When you select an assembly, the .NET Adapter populates this control with a list of classes defined for that assembly.
  • Create Object—Specifies whether the step creates a new object, and whether to operate on the object locally or on a remote system. When you enable Create Object, you can launch the Configure Class Constructor floating pane by clicking the Customize Constructor button, in which you can.
  • Call Method or Access Property—Specifies if the step invokes a class method or accesses a class property when the .NET Adapter executes the step. The Call Method or Access Property section contains the following items:
    • Member Type—Lists the types of access that the assembly defines for the selected object class. The options are: Do Not Call, Call Method, Get property, and Set Property. For example, if an object class does not have any methods, the control does not list the Call Method option.

      After you select the type of access, the .NET Adapter populates the member control with the method and property names that the class defines for the access type.
    • Member—Specifies the method that the step invokes or the property value that the step accesses.
    • Show Base Class Members—Specifies to include the methods and properties of derived classes in the Member ring control.
  • Parameters Table—Contains the input and output parameters for the selected method or property. The control can contain any number of input and output parameters. The .NET Adapter automatically populates the value field for parameters that have default values. The following columns are found in the Parameters Table control:
    • Parameter Name—Displays the name of the parameter.
    • Type—.NET data type for the parameter.
      For one-dimensional arrays, you can specify an expression value for the entire array, or you can specify values for each element of the array. Use the plus button (+) to insert a new element in the array, and the minus button (-) to remove specific elements from the array.
    • In/Out—Specifies whether the parameter is an input or output.
    • Dispose—Specifies whether TestStand calls the Dispose method on the .NET object when the output parameter references are released. If the object does not implement the IDisposable interface, this option is ignored.
    • Use Default Value—Specifies whether TestStand uses the default value of the control for the parameter.
    • Value—A TestStand expression. For input parameters, TestStand passes the value of this expression. For output parameters, TestStand stores the data that the method returns in the location this expression specifies. To help you enter an expression in the Value column, click the Expression Browse button to launch the Expression Browser dialog box. For enumerated types, a combo box displays all valid values for the type. You can still use an expression with an enumerated type.

See Also

.NET Source Code Files Window

Configure Class Constructor Window

Expression Browser Dialog Box


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit