LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing dll...

Hi,

 

A basic understanding I do not have so this is the reason for this series of question for where I might get help and direction from yourselves.

 

I managed to generate an executable in LabWindows/CVI 2010 containing a UIR with a table, which is filled from an ini file. I can select any entry in the resulting table and return it contents (thanks to Roberto Bozzolo).

 

Now I need to incorporate it in TestStand 2010 SP1 but as a dll.

 

I have tried to tackle the example cvidll but still the questions are there.

 

The reason this is been done is that we must rewriting LabView 7.1 and VisualC++ 6.00 code, all dll’s, and moving to LabWindows/CVI 2010.

 

  1. I am struggling with building a dll, an Idiots guide to dll’s would be useful
  2. Trying to understand how to convert from an exe to a dll
  3. To pass 2 or more parameters to the dll and receiving 2 or more results back from the dll
  4. Possible not for this discussion group, is to incorporate the all it into TestStand 2010 SP1 passing parameters back and forth.

 

As always thanks

Simon

 

0 Kudos
Message 1 of 2
(2,987 Views)

Hi Simon,

 

With regards to building a DLL from scratch in LabWindows/CVI the process is:

1. Start a new project

2. Select Build>Target Type>Dynamic Link Library

3. Create a new C source file (the DLL Source Code)

4. Save the source file and add it to the project (File>Add yourfilename.c to Project)

5. Create a new header file that contains the necessary calls to the functions you want to export with the DLL

6. Ensure you save the project

7. Select Build>Target Settings to bring up the "Target Settings" dialog

8. Click "Import Library Settings" and select Generate import libraries for both complilers followed by OK

9. Click "Change"in the Exports section and select the header file you created earlier

10. Select Build>Configuration>Release

11. Select Build>Create Dynamic Linked Library to complete the process and create a dll with the name of your header file (as default)

In addition to a DLL, the import libraries get generated.

 

Regarding conversion of a exe to a dll I would suggest to start a new DLL-Project in LabWindows/CVI (using process above) and then copying all the functions from your exe-project to the DLL project and declare them to be exported.

 

Hope this helps getting you started in developing a DLL in LabWindows/CVI.

 

Thanks

 

Jamie S.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,971 Views)