LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import dll wizard: using a c++ header in Labview 8.2

I am attempting to use the new feature in LV 8.2, the import dll wizard, to control an Amptek x-ray spectrometer.  Amptek was helpful enough to supply a dll file and corresponding header, written in c++ code.  However, Labview is having some trouble with this header.  While the wizard does understand 20 of the 42 possible functions on the dll, the remaining 22 are not imported.  These are all the functions including "LPCSTR," "LPSTR," or "UCHAR."

I'm guessing that there is some difference between c++ and whatever code LV reads in.  Do you have any information that could help me?  I need to somehow change the header so that Labview will understand all of the dll functions.
0 Kudos
Message 1 of 6
(4,204 Views)

Have you made sure the DLL has all require dependencies? If not, this KnowledgeBase will be a great place to start.

Cheers,

Emilie

0 Kudos
Message 2 of 6
(4,189 Views)
Thanks!  I ran the program suggested.  I have all dependencies needed for this dll, but the problem remains.

Some of the functions on the dll (opening or closing the api or the usb, getting usb status) are working fine.  I believe the problem is in the header.  LV can only seem to understand half of the definitions.  Critical functions are not being imported.

Here is an example of the code for a function that wasn't imported, GetConfigFromFile:

void __stdcall GetConfigFromFile(
                                 void * objptr,                                 // @parm Pointer to the DPPAPI.
                                 LPCSTR pszFilename,               // @parm Dpp configuration filename.
                                 LONG cSize,                               // @parm Character buffer size.
                                 byte DPPDeviceType)                // @parm DPP Device Type
                                 ;

Is there any reason this would confuse Labview?

Tara
0 Kudos
Message 3 of 6
(4,167 Views)

Hi Tara,

Well, from the looks of this, it seems as though perhaps the function is not being exported properly. Rather, with the way this is declared, I would say it might be internal to the .dll. Have you reviewed the functions that are successfully imported to LabVIEW? You can look and see how those are being declared. There may be some indication in the declaration that they are being exported, while others are not.

Let me know if you find anything.

Cheers,

Emilie

0 Kudos
Message 4 of 6
(4,145 Views)

I am working with Labview 8.6 and an Amptek spectrometer.  I have quite a few of the dll fundtions working, but not the GetStatusStruct.

do you have that one working?  If so, I would love to have a copy of it.

thanks,

Gretchen

0 Kudos
Message 5 of 6
(3,856 Views)

Gretchen,

 

Structures can't be imported -- but you can change them to typedefs or make a fake header file and change them to typedefs and they will work fine.

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 6
(3,840 Views)