Creating a DLL for a LabWindows/CVI Custom Code Generator

TestStand ATML Toolkit 2017 Help

Edition Date: June 2018

Part Number: 374205B-01

»View Product Info
Download Help (Windows Only)

You can create a DLL that contains the functions for a LabWindows/CVI custom code generator and use the DLL you create as a starting point for customizing the code generator behavior.

Note Note  When you create a function in a C file to implement a custom code generator callback, the function must use the same name as the LabWindows/CVI or Visual C++ function prototype that implements the same callback. For example, if you create a function to implement the PreTranslateAction callback, the function name must be CodeGenerator_PreTranslateAction(). If you use a function prototype as a starting point to implement a callback, National Instruments recommends that you copy the example source files to another location and modify the copies so that you do not modify the examples the ATML Toolkit installs.

Complete the following steps to create a new DLL and configure the ATML TD translator to use the DLL as a custom code generator.

Note Note  You can also copy the existing example project and source files from the <TestStand Public>\Examples\Toolkits\ATMLTDTranslator\Code Generator\LabVIEW directory and modify the copies.
  1. Select Project from Template in the New section of the LabWindows/CVI welcome page, or select File»New»Project From Template in LabWindows/CVI to launch the New Project From Template dialog box.
  2. In the template type control, select Dynamic-Link Library.
  3. Specify a name, directory, and path for the LabWindows/CVI project in the Project name, Project folder, and Project path controls, respectively.
  4. Click OK to create the project and source files and close the New Project From Template dialog box. A new Workspace window opens in LabWindows/CVI.
  5. Use the recommended LabWindows/CVI function prototype or Visual C++ function prototype to implement the body of the function for the callback. Refer to the LabWindows/CVI project and source files located in the <TestStand Public>\Examples\Toolkits\ATMLTDTranslator\Code Generator\CVI directory for examples of how to implement callbacks in a LabWindows/CVI DLL.
    Note Note  You must expose the prototype of each callback as __stdcall in the DLL.
  6. Select Build»Create Debuggable Dynamic Link Library to build the LabWindows/CVI project.
  7. Complete the following steps to configure the ATML TD translator to call the DLL you created as a LabWindows/CVI custom code generator.
    1. In TestStand, select Tools»Configure ATML TD Translator to launch the ATML Test Description Translator Configuration dialog box.
    2. Click the Code Module Settings tab and enable the LabWindows/CVI option.
    3. In the Path to Custom Code Generator DLL control, enter or browse to the complete path for the path you specified in step 3.

See Also

ATML Test Description Translator Configuration dialog box

Recommended LabWindows/CVI Function Prototypes

WAS THIS ARTICLE HELPFUL?

Not Helpful