11-18-2009 08:08 PM
Hi all,
I'm new to labview programming. I've checked pretty much all posts regarding my problem but they are ended with no clear answer.
I'm working on a firmware running on a development kit and I'm trying to communicate with the board through USB from Labview in Windows environment. For that, I've built a DLL which enumerates, opens Read/Write file handle and does a few other functions. I'm using standard Windows APIs for USB initialization.
I use "Call libr. function node" in labview to call these dll's. Inside the DLL, I use a function to initialize the USB which returns a device handle to the labview. My question is, in "Call libr. function node" what is the parameter type I should use in "Call libr. function node" to receive the device handle? The device/file handle is defined in the WinAPI as a void pointer.
Any help will be much appreciated.
Regards,
Hari
Solved! Go to Solution.
11-18-2009 10:50 PM
11-19-2009 03:44 AM
Well a Windows handle is defined as a pointer to void. So it is pointer sized. That makes a handles size dependant on the bitness of your platform. For future compatibility and if you have LabVIEW 8.6 or newer you should configure that parameter as pointer sized integer. LabVIEW will then take care about passing a 32 bit value to the DLL when running as LabVIEW for 32 Bit and a 64 bit value when running as LabVIEW for 64 bit.
If you use a normal integer you would have to change the parameter yourself between 32 bit and 64 bit when changing platforms.