Communicating with Bluetooth Devices in LabVIEW

Updated Sep 24, 2024

Reported In

Software

  • LabVIEW

Operating System

  • Windows

Issue Details

I have a Bluetooth device that I want to use with LabVIEW. How do I make it work in LabVIEW, and does it need to use the Windows Bluetooth stack?

Solution

To use a USB Bluetooth device in LabVIEW, the device must use the Windows Bluetooth stack. If it does, the steps are:
  1. Plug the USB Blutetooth device into the PC.  
  2. Allow Windows to automatically install the drivers.  
Note that you cannot install the non-Windows drivers that may come with the device. Doing so will overwrite the Windows Bluetooth stack and will cause the device to not work in LabVIEW, forcing you to use the instructions below. In these situations the Bluetooth example included in LabVIEW will likely return Error 58: Network function is not supported by the system. 
 

Additional Information

If the device is not on the list or you have installed the drivers that have come with the device, follow the following steps:
1. Plug the USB Bluetooth device into the PC and allow the installation to fail.
2. Right-click on My Computer then click Properties»Hardware Tab»Device Manager.
3. Find the device on the list of Universal Serial Bus controllers if you haven't installed the provided Bluetooth stack. If you have, find it under Bluetooth Radios.
4. Right-click on the device and select Properties. Go to the Details tab and select Hardware Ids from the dropdown options as shown in Figure 1. Copy out all the listed hardware IDs, including the revision codes, into a text file, and save the file.
 
Figure 1. selecting a Bluetooth hardware ID in the Bluetooth Adapter properties.
5. Unplug the device from the PC.
6. Completely uninstall any of the drivers that you may have installed with the device through Add/Remove Programs in the Windows Control Panel.
7. Navigate to C:\Windows\inf\. Locate bth.inf within that folder. If it does not exist, find bth.BAK and rename it to bth.inf. Note: It is recommended that you back up this file before editing it.
8. Edit the file with Notepad. Within the file, find the entries that appear similarly to: USB Bluetooth Wireless Adapter= BthUsb, USB\Vid_1310&Pid_001. Create a new entry for each Hardware ID copied in step 4, renaming USB Bluetooth Wireless Adapter to the manufacturer of the device .
9. Reboot Windows.
10. Re-insert the device into the PC.
11. Windows should successfully automatically install the device.

Note: This workaround may not work with all Bluetooth USB devices. It was found to work with the D-Link DBT-120.

RFmx VIs

An alternative to the LabVIEW Bluetooth VIs is to utilize NI RFmx, specifically RFmx Bluetooth technology. RFmx Bluetooth allows you to generate and analyze signals for Bluetooth Basic Rate (BR), Enhanced Data Rate (EDR), and Low Energy (LE) test applications. With RFmx, you can perform and debug measurements quickly and easily with interactive software front panels; create and play back open, unlocked waveforms with RFmx Waveform Creator; and speed up automated testing with the performance-optimized API.