From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Bluetooth Discover while searching

Solved!
Go to solution

Hello!

 

I try to make bluetooth connect window like "Add Bluetooth Device Wizard" in MS WINDOWS. I start from this:

BT.png

 

It works well, i can see my devices, and devices disappear when i switch them off. searching time (or update time) 6 sec. in Add Bluetooth Device Wizard it is 10 sec. But i can't stop the search in this 6 sec, it just freezing for this time. In "Add Bluetooth Device Wizard" i can press on chosen device and it stop searching or i can press cancel button. Thank you, i'm new in LabVIEW.

 

P.S i don't know why but it makes only one search without  flat sequence structure.

0 Kudos
Message 1 of 2
(2,424 Views)
Solution
Accepted by timbak

Hi timbak,

 

Actually what is wrong in your program is the sequence structure. This structure cannot be stopped until the code within is completely executed. So when you push the stop-button, first the code in the sequence is executed and then the loop is stopped.

 

Your code also doesn't make only one search but it displays only the last one because the indicator "device list" is in the loop. If you want to see the results of all iterations, it would be better if you used an auto-indexed tunnel and connect it with a 2-dimentional array of clusters where all the devices for every search are displayed, or you can simply use the Bluetooth discover function without a while loop (which I think is better).

 

There is a good example in LabVIEW that you can use. go to help >> find examples und in the NI Example finder you can either search the word "Bluetooth" or navigate to "Networking >> Bluetooth" and you will find the project "Simple Bluetooth.lvproj"

 

I hope this helps.

Best Regards

Maha

0 Kudos
Message 2 of 2
(2,394 Views)