Embedding Type Libraries in a LabWindows/CVI DLL for use in TestStand

Updated Oct 27, 2020

Environment

Software

  • TestStand
  • LabWindows/CVI

Programming Language

  • C
  • C++

Other

LabWindows/CVI
TestStand
 

I am trying to call a LabWindows/CVI DLL from TestStand and I would like the Function Name ring control to auto-populate with my functions names and the Parameters panel to populate with all of my parameters, including custom struct types. How can I do this?

The Function Name ring control automatically populates with the function names of the DLL if a type library is associated with that DLL. This is required if you create a DLL using LabWindows/CVI 7.0 or earlier. If you are using LabWindows/CVI 7.1 or later, TestStand can read the function names from the DLL.

However, if you would like all parameter information to populate correctly, including custom struct types, you will need to use a type library.

To include a type library in a DLL built in LabWindows/CVI, you must create an instrument driver .fp file that contains the function panels for each of the functions that you want to export from your DLL.

If you already have a DLL created, create a new .fp file in LabWindows/CVI for each of the exported functions, and then attach your DLL as the source for the .fp instrument driver. If you have not already created your DLL, create your .fp instrument driver file first in the same fashion that you would if the DLL was created first. The main advantage of creating your .fp first is that you can use the automatic code generation feature of LabWindows/CVI to generate skeleton source files with all of your prototypes and empty function definitions automatically created. This helps to avoid typing mistakes in type, variable, and function names.

To find information on how to create .fp instrument driver files, refer to the LabWindows/CVI Help (Inside LabWindows, select Help » Contents).

Once you have created your .fp file and you are ready to build your DLL, select Build » Target Type » Dynamic Link Library. Then select Build » Target Settings and click the Type Library button to embed your .fp file.