LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Bluetooth Low Energy Driver development

This forum demonstrate on how to use the windows 10 BLE native library to communicate with BLE devices (Smart watch, bulb or any device which support BLE). Developed the DLL to interact with windows 10 BLE library in C# platform and integrated the dll into LabVIEW by using .Net constructor node.

 

Here demonstrates usage of the Bluetooth Generic Attribute (GATT) Client APIs for Universal Windows Platform (UWP), along with sample code for common GATT client tasks:

  • Query for nearby devices
  • Connect to device
  • Enumerate the supported services and characteristics of the device
  • Read and write to a characteristic
  • Subscribe for notifications when characteristic value change

 

How to Use

Following are the methods available in BLE library:

 

Methods:

  1. BLE_Initialize.vi - Initialize the DLL
  2. BLE_StartWatcher.vi - listening advertisement of near by BLE devices
  3. BLE_Get_WatcherResponse.vi - Gets the manufacture data, BLE address from BLE advertisement
  4. BLE_Get_WatcherReceivedData.vi - Decodes the watcher response
  5. BLE_StopWatcher.vi - Stop getting advertisement from near by BLE devices
  6. BLE_Request_Connect.vi - Initiates the connection to BLE device and returns with response of connection status and GATT Services list from BLE device
  7. BLE_Get_ServicesUUIDs_Property.vi - Gets the GATT service UUIDs and Property UUIDS from BLE device
  8. BLE_Notify.vi - Initiate the BLE notification of UUIDs from BLE device
  9. BLE_Notify_Listener.vi - Gets the notification of UUIDs from BLE device
  10. BLE_Read_Characteristic.vi - Reads the UUIDs of BLE device
  11. BLE_Read_CharacteristicArray.vi - Reads the array of UUIDs of BLE device
  12. BLE_Request_ServiceUUIDs.vi - Get the Service UUIDs
  13. BLE_Write.vi - Write the UUIDs of BLE device
  14. BLE_Write_Without_Response.vi - Write the without response UUIDs of BLE device and not return response

When setting the debug logs to true, C# library created the BLE log files under C drive

 

Development Environment:

LabVIEW 2020 32 Bit

OS: Win 10 64 bit

 

This driver VIs does not require any dongle to communicate with BLE device. It uses the native Win 10 UWP library to communicate with BLE devices

0 Kudos
Message 1 of 5
(1,491 Views)

Wish this application was available for CVI as well.

0 Kudos
Message 2 of 5
(1,070 Views)

Hi, can you tell me how connecting with a pin code works?

0 Kudos
Message 3 of 5
(332 Views)

Hi,

I've been experimenting with the Arduino MKR WiFi 1010 and have successfully read characteristics into LabVIEW. However, I'm facing issues when trying to write any characteristics. Despite setting them to "BLEWrite" or "BLEWriteWithoutResponse" in Arduino and using the corresponding write function in LabVIEW, the result is always "Non Write Property" (BLE_Write_Without_Response.vi) or "One or more errors occurred." (BLE_write.vi). What could I be missing?

You can find the Arduino code here:

 

 

https://docs.arduino.cc/tutorials/mkr-wifi-1010/enabling-ble/

 

 

https://docs.arduino.cc/tutorials/mkr-wifi-1010/enabling-ble/

0 Kudos
Message 4 of 5
(44 Views)

Hello,

 

As always, just after posting here I managed to resolve the issue. The key to success was found here:

 

https://se.mathworks.com/matlabcentral/answers/556798-ble-write-to-arduino-nano-33-ble-is-unsuccessf...

0 Kudos
Message 5 of 5
(35 Views)