LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Function Panel Problem. Can't find prototype

I have made a function panel based on a main() program that worked when it was an executable. The function uses a c DLL. When I try to make this into a function panel using the same DLL it can not seem to find the function prototypes. If I run my debug_exe and then try to run my function panel it then can find the prototype, and it works fine as long as I am in CVI. Please help, I need to figure this out to develop some Instrument drivers for some equipment that needs to use a C DLL.
0 Kudos
Message 1 of 2
(3,062 Views)
Hello Craig,
You may want to start by reading the "LabWindows/CVI Instrument Driver Development Guide" which you may find in pdf format on your system "InstDriv.pdf" or online at http://www.ni.com/manuals. It sounds like you are trying to write a function panel wrapper to an existing C DLL. In this case, you should save your FP file with the same name as your DLL. You will also need an include file (.h) with function declarations (prototypes) and something to link to besides the DLL (an import source, object, or static library). If your Function Panel is complete (has the proper function names, parameters, and return values) then you can open it (File >> Open >> Function Tree) and use Options >> Generate Function Prototypes to generate the include file. You can then
open the include file (File >> Open >> Include) and use Options >> Generate DLL Import Library to generate the required static import library for your function panel to work. Now to use the function panel go to Instrument >> Load and select your Function Panel. After this you can check it's status by going to Instrument >> Edit >> Show Info (the Program File item should show the Import Library you generated above). It should also add a link to the include file when you try to compile your test application.

Jeremiah Cox
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(3,062 Views)