LabWindows/CVI Module Tab

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Insert a step configured to use the LabWindows/CVI Adapter and select Specify Module or Step Settings from the context menu to display the LabWindows/CVI Module tab in the TestStand Sequence Editor.

You can use the LabWindows/CVI Module tab to specify the function prototype, which includes the data type of each parameter and the values to pass for each parameter. The Parameters Table control shows all the available parameters for the function call and an entry for the return value. You can insert, remove, or rearrange the order of the parameters.

LabWindows/CVI Module tab also includes source code buttons for creating and editing code modules in LabWindows/CVI. You can also use the source code buttons to resolve differences between the parameter list in the source code and the parameter information on the LabWindows/CVI Module tab. You do not have to use the source code buttons for TestStand to call the code module.

Note Note  National Instruments recommends using DLL files when you develop code modules using the LabWindows/CVI Adapter.

The LabWindows/CVI Module tab contains the following options:

  • Module—The pathname of the code module file that contains the function the step calls. You can specify an absolute or relative pathname for the module file. Relative pathnames are relative to the TestStand search directory paths. Use the Edit Search Directories dialog box to customize the search directory paths.

    With the exception of custom user interfaces, you cannot use a side-by-side version of the LabWindows/CVI Run-Time Engine (RTE) with .lib, .obj, or .c code modules. These code modules always use the default LabWindows/CVI RTE even when the module is an import library for a DLL that uses the side-by-side version of the LabWindows/CVI RTE. To call a DLL code module that uses the side-by-side version of the LabWindows/CVI RTE in this case, specify the code module with the path of the DLL, not the path of the import library.

    If you select a debug .dll built by LabWindows CVI 2019 or later, then the CVI Project File to Open on the CVI Source Code Files Window updates to the LabWindows/CVI .prj file that was used to build the selected .dll.
  • Reload Prototype—Requests that the LabWindows/CVI Adapter query the code module for prototype information for the currently selected function. If a DLL contains export information or a type library or there is a type library with the same name as the DLL file and the function is defined in the type library, TestStand uses the prototype.
    Note  If you create a DLL using LabWindows/CVI 7.1 or later, TestStand can read the prototype information for the currently selected function without the use of a type library.
    If the code module is a debug .dll built by LabWindows/CVI 2019 or later, then the CVI Project File to Open and the Source File that Contains Function on the CVI Source Code Files Window updates to the LabWindows/CVI .prj and .c that were used to build the .dll.
  • Always Run In Process—Specifies whether the step always runs in-process even if the LabWindows/CVI Adapter is configured to run out-of-process. Use this option when you do not want the global settings for the adapter to affect the tools and step types you create for use with the LabWindows/CVI Adapter.
  • Function—Selects the function in the code module the step calls. The LabWindows/CVI Adapter attempts to read the code module file and find the names of all functions. When the code module type is not a C source file, the LabWindows/CVI Adapter populates the Function Name ring control with the names of all the functions the code module contains.

    If you select a debug .dll built by LabWindows/CVI 2019 or later as the Module, then the Source File that Contains Function on the CVI Source Code Files Window updates to the .c file path that was used to build the .dll.
  • Code Template—The code template to which the module call adheres. TestStand lists the code templates the step type defines. The Code Template control contains the following default options:
    • None—Specifies if the module call does not adhere to a prototype of any code template. When you select this option, the New and Delete buttons in the Parameters Table are enabled.
    • Default template for LabWindows/CVI—Specifies whether the module adheres to the default template for the LabWindows/CVI adapter.
    • Legacy default template—Specifies whether the module adheres to the legacy prototype of the LabWindows/CVI Adapter. TestStand includes this option when you enable legacy templates on the LabWindows/CVI Adapter Configuration dialog box.
  • Parameters Table—Shows all of the available parameters for the function call and an entry for the return value. The Parameters Table control contains the following columns:
    • Parameter Name—A symbolic name for the parameter.
      Note Note  Parameters with attributes include an Edit Attributes button in the Name column of the Parameters Table. TestStand associates parameter attributes with the module parameter, which TestStand stores with the step configuration information, not with the parameter value that TestStand passes to the module. Right-click an item in the Parameters Table to access the Parameters Table context menu, from which you can launch the Attributes dialog box.
    • Description—The short description of the parameter type using ANSI C syntax.
    • Create/Update Custom Data Type—Launches the Create/Update Custom Data Type from Struct dialog box, in which you can configure a new custom data type or update an existing custom data type.
    • Log—When you enable this option, the step logs the parameter as an additional result. Enabling this option is equivalent to using the checkbox next to the additional result name on the Additional Results panel of the Properties tab of the Step Settings pane. For in/out parameters, enabling this option enables the [In] parameter and the [Out] parameter on the Additional Results panel. This option is indeterminate for in/out parameters if you specify to log only the [In] parameter value or only the [Out] parameter value. If this option is indeterminate, a tooltip specifies whether the Additional Results panel specifies to log the [In] parameter value or the [Out] parameter value.
    • Value Expression—The argument expression to pass.
    When you select a parameter in the Parameters Table control, the Parameter Details Table control contains the specific details about the parameter. The data type (Numeric, String, Enumeration, Object, C Struct, or Array) determines the information required for a parameter. As an alternative to specifying the function name and the parameter values, you can use the Function Call control to directly edit the function name and all the function arguments at once. To insert or remove parameters, click New or Delete. To rearrange the parameter order, select the parameter you want to move and click Move Up or Move Down. You must select the None code template before attempting to insert, remove, or rearrange parameters.
  • Parameter Details Table—The data type of each parameter and additional information according to each parameter type. The Category ring control specifies a group of data types to list in the Type ring control. The categories include: Numeric, String, Enumeration, Object, C Struct, Arrays, TestData, TestError, and Pointer/Handle. The Type control specifies the data type of the function parameter.
    Note  The LabWindows/CVI Adapter supports numeric return values, which includes Boolean, void*, and void.
  • Create Code—Creates the source code shell for the function.

    If the source file you specify does not already exist, the LabWindows/CVI Adapter creates it. If the file already exists, the LabWindows/CVI Adapter dialog box opens and gives you the choice of replacing the current function or adding the new function shell above the current function. If a code template file exists for the step type you use for the step, the LabWindows/CVI Adapter uses the template to create the shell of the new function. If the project file you specify does not already exist, the LabWindows/CVI Adapter creates a new project file and adds the source file to it.

  • Edit Code—Edits the source code for the function. The LabWindows/CVI Adapter launches a copy of LabWindows/CVI and opens the source file. When you specify a project file in the Source Code tab, the LabWindows/CVI Adapter also opens the project in LabWindows/CVI.

    Note Note  If LabWindows/CVI returns a warning when you open a project that some TestStand API files were not found, remove the files from the project and then add them again from the <National Instruments>\Shared\CVI\instr\TestStand\API directory. The <National Instruments> directory is located at C:\<Program Files>. The <CVI> directory is located at C:\<Program Files>\National Instruments.
  • Verify Prototype—Checks for any conflicts between the source code and the parameter information on the Module tab.
  • Source Code Files—Launches the CVI Source Code Files window, in which you can specify the pathname for the source file and project file that implements the function the module calls.
  • Function Call—Directly edits the function name and all of function arguments at once.

Editing the Function Call

You can use various controls in the Module tab to edit the function name and the argument values of the function. Alternatively, you can use the Function Call control to directly edit the function name and all of the function arguments at once. In the Function Call control, edit the call just as you would in a source code editor. If you enter a different number of arguments than the function prototype specifies or enter a different argument type, TestStand prompts you to alter the prototype to match the number and type of arguments you specify.

When you edit a call in the Function Call control, the Revert and Accept buttons are visible. All other controls are dimmed.

  • Accept—Applies the changes you made in the Function Call control.
  • Revert—Discards the changes you make in the Function Call control.

See Also

Attributes dialog box

Calling Legacy LabWindows/CVI Code Modules

CVI Source Code Files Window

Edit Search Directories dialog box

Locating the Correct DLL in 32-bit TestStand and 64-bit TestStand

Parameters Table Context Menu for Module Tabs

Step Settings Pane

Using Side-by-Side Versions of the LabWindows/CVI Run-Time Engine with TestStand

Using the $(Platform) Path Macro to Locate the Correct Code Module in 32-bit TestStand and 64-bit TestStand

WAS THIS ARTICLE HELPFUL?

Not Helpful