LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

BLE problem importing BluetoothAPIs_dll into Labview

Hello,

 

I was trying to utilise inbuilt bluetooth device(BLE enabled, using windows 10 which was upgraded from windows 8.1, 64bit) with Labview VI to communicate with a BLE device. The only solution I found is to utilise/importing Microsoft BLE stack into labview through shared libraries.

Now, I tried dowloading recent version of Microsoft Kit and utilised BluetoothAPIs.dll in system32 directory for the same. I keep getting "The library contains 97 functions. But no function is found and recognized in the header file" and none of the functions are enabled.

I believe and cross checked all the installed software's are 64bit.

Please give me some solution, if in case anyone had the same problem and solved it.

 

Thanks.

 

0 Kudos
Message 1 of 6
(5,921 Views)

Hey kiran.holla,

 

A few questions to start us of:

 

1. Can you share this DLL and applicable header files?  It would do wonders to recreate the issue.  What is the Microsoft Kit you are using?

 

2.  Are you using the Call Library Function node in LabVIEW?

 

3.  Are you able to call that DLL with any application other than LabVIEW?  If not, this may be something you'll have to contact Microsoft about.

 

4. Can you verify that your LabVIEW is 64-bit?

 

Thanks!

 

Eric
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,868 Views)

Hello Hazen_berg,

 

Thanks for the reply.

 

1. Please find attached DLL and header files. My windows os version and Microsoft Kit version are the same(10.0.10586.0). Sorry I renamed dll file to doc.

2. I used import/shared library(dll) to create VI's from shared dll. Can't I do this? Should I have to create manually using Call Library Function node?

3. Yes I can, since I can scan all the BLE devices using OS Bluetooth settings.

4.  Yes it is. I have attached screen shot of it.

 

Thanks,

 

Kiran

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

This API won't really help you with BLE. It's the normal Bluetooth API that was already present in Windows XP.

 

For BLE you want to use the GATT APIs described here.

 

And many of those APIs use complicated datatypes that the import library wizard can't possibly create correct VIs for. So you likely have to create the VIs with Call Library Nodes yourself and considering how complicated that API is I would definitely recommend to write a wrapper DLL in C, which translates between the Windows API function parameters and more LabVIEW friendly parameters to call from LabVIEW.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 6
(5,843 Views)

Thanks Rolf,

Yeah, I agree it's too complicated and time consuming to create the VI's with Call Library Nodes for some 97 functions. As of now I believe the only best possible way as Rolf suggested is to write wrapper DLL in C/C++.

Is there any link/sample for Labview friendly BLE C wrapper code already done?

 

Thanks,

 

Kiran

0 Kudos
Message 5 of 6
(5,832 Views)

I'm afraid there isn't specific LabVIEW friendly sample code for this particular API. You should be able to find other BLE sample code though that you can use as starting point.

 

You either want to use this API and write a wrapper DLL around it to be called from a Call Library Node or you might get away by accessing some kind of .Net interface instead. Possibly someone already has made a .Net assembly somewhere that could be used with the LabVIEW .Net functions. That would save you a lot of work for writing the wrapper DLL.

 

Microsoft really wants to push developers into using the Windows RT system and mostly provides samples for that. The reason being that the Windows RT system is the common denominator for all Windows 10 platforms, be it mobile, tablet or desktop. Unfortunately LabVIEW with its machine compiled executable architecture can  not be used for that, but the interface to Windows RT components is entirely .Net based, so if you find a .Net component that can run on a desktop Windows system, you can interface it with the LabVIEW .Net functions and that is maybe not really less work as the .Net object hierarchy of most APIs can get quite involved and complicated too, but you have only limited possibilities during development to mess up pointers and such which will cause crashes. DLL development in C(++) however is always a compile, debug, and crash cycle that gets repeated over and over again.

Rolf Kalbermatter
My Blog
Message 6 of 6
(5,804 Views)