LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI and building DLLs

Hello,

 

I am generally wondering how I can call a function that I wrote in CVI using test stand. Test stand is my test executive and I am simply trying to do a function call. I have CVI 2017 and I created a project with one source file in it. It's call Main.c and it's attached. This contains just one function definition and implementation. It's a function that takes an int and converts it into a binary representation which is stored in an array. The function returns a pointer to that array. The function has three parameters and returns the pointer.

 

How do I build this into a DLL? When I attempt to I get the warning: "DLL has no exports. No Import Library created"

 

I read somewhere about creating a header file, so I created one and added it to the project and included the function prototype in it. 

 

I want to ultimately use this DLL in test stand and simply be able to access that one function. 

 

I have attached the .c source file. 

 

Thank you

0 Kudos
Message 1 of 4
(1,041 Views)

UPDATE: I tried to follow the advice of Jamie S. from this related post: https://forums.ni.com/t5/LabWindows-CVI/Writing-dll/m-p/1751708#M55129

 

Thought the 'target settings' menu has changed from how he described it, I set the header file under the export options and this  successfully created a DLL. Though Test Stand doesn't seem to recognize the return type when I load the DLL and call the function (the function returns a pointer to char) 

 

I might post this in TS forum. 

0 Kudos
Message 2 of 4
(1,024 Views)

What versions of TestStand and CVI are you using? We made a bunch of related improvements in the 2019 versions of both, with the caveat that you have to be using the 2019 versions of both

https://zone.ni.com/reference/en-XX/help/370052AA-01/tshelp/infotopics/2019whatsnew/#CVI

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 3 of 4
(970 Views)

I'm using CVI 2017 and TS 2017 SP1. 

0 Kudos
Message 4 of 4
(967 Views)