Jump to content

header and dll don't reconize fonction


Recommended Posts

Hello,

 

I would like drive my DAQ with labview, but this card dont reconize (humusoft AD612). I would like use *.dll. But i want use this and header.I use library share but labview don't assign fuction to prototype.

I think my problem is wtih preprocessing.

 

I try to put --cpluplus;_win32;win64, but me header don't reconize.

 

 

ad612.zip

Link to comment
Hello,

 

I would like drive my DAQ with labview, but this card dont reconize (humusoft AD612). I would like use *.dll. But i want use this and header.I use library share but labview don't assign fuction to prototype.

I think my problem is wtih preprocessing.

 

I try to put --cpluplus;_win32;win64, but me header don't reconize.

 

You don't need any of those defines except _WIN32 (and possibly _WIN64) (and case is important). But you also need to define size_t. This is not a standard C datatype but one typically defined in one of the standard headers (stddef.h) of the compiler.

 

The exact define is in fact compiler dependent but for Visual C

 

size_t=unsigned __int64 ; for 64 bit

size_t=unsigned int ; for 32 bit

 

should do it. But I'm not sure if the import library wizard would recognize the Visual C specific type "__int64" nor if the more official "long long" would be recognized, since I don't normally use the import library wizard at all.

 

Link to comment

Thank, almost prototype reconize, exept callInstaller and GetBoardIOAddress.

 i try with only "size_t=unsigned int ; _WIN32;_WIN64;", it's ok .

 

Finally I put "_WIN32;_WIN64;_cplusplus;size_t=unsigned __int64;size_t=unsigned int ".

because my system is 64 bit, but labview install in 64 bit and 32 bit.



I am finish compilation, i have got 2 error with

 

  Hudaq Get Parameter.vi
Hudaq Set Parameter.vi

. Struct is too complexe...

Link to comment

you should only use _WIN64 if you intend to use the resulting VI library in LabVIEW for Windows 64. And for the datatypes that are size_t (the HUDAQHANDLE) you should afterwards go through the entire VI library and change all Call Library Node definitions of them to pointer sized integer manually.

 

Since the developer of the DLL decided to change the calling notation of the functions between 32 bit and 64 bit DLL, you have to be careful to import the header file for each platform seperatly (with and without the _WIN64 declaration) and keep those VI libraries seperate and use whatever version you LabVIEW version is. It does not matter what OS bitness you have but the bitness of the LabVIEW installation you use. So if you use LabVIEW 32 bit even on Windows 64 bit, you have to leave the _WIN64 keyword away from the definitions.

 

Going strictly with size_t=unsigned integer, will cause the handle to be defined as 32 bit integer and therefore get truncated to 32 bit on LabVIEW for 64 bit systems (and obviously corrupt the handle in that way). Setting it to strictly 64 bit integer however will pass 2 32 bit values on the stack and therefore misalign the premaining parameters on the stack.

 

The two functions you name, are NOT declared in the header file and therefore can not be imported by the Import Library Wizard.

 

As to the errors, the parser apparently gets a hickup on the nested enum declarations. You will have to create that as a Ring Control manually.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.