Showing results for 
Search instead for 
Did you mean: 

Bluetooth Read VI dropping connection

Hey everyone,


A little background first: We have a sensor mounted on a brace and it is sending data through Bluetooth to the PC. We need data to be sent indefinitely per se, or rather, till the athlete is out of range and/or for some bizarre reason connection is dropped. (We have a microSD card that kicks in to save the data in the event that happens so no worries there.)


Having that said, this vi and sub vi we have so far, runs perfect but only runs ONE time. Giving us only a few seconds worth of data points. We have changed the case structure for a While loop but it loses functionality. It either reads but does not write, or simply runs forever without anything coming up. On that note, the real question we are asking is then, any ideas on what the logic would be to trigger the loop to run UNTIL signal is dropped and how to implement it in LabVIEW?


Any help/suggestions is greatly appreciated. Thank you!


0 Kudos
Message 1 of 4

You could create a for loop with a conditional terminal - then it can stop the iterations on error. In this situation that would be losing the bluetooth connection.

Message 2 of 4

Thank you for your suggestion. We did actually try that and it gets stuck in the loop forever without actually reading/saving data at all. It was with a While loop though. With a for loop we would have to state the iterations needed which does not quite work in our case.


We have it working right now with a simple "stop" button on the Front Panel, however, still trying to figure out how to make it stop when it loses signal from our Bluetooth shield. 


Thanks a lot again!

0 Kudos
Message 3 of 4
Could you determine how often data is supposed to stream? I'm not sure how it works, but if it is supposed to get data every 1 second and you have waited 5 seconds and no new data has come then can you assume the Bluetooth is out of range or lost a connection? You can use timing information to determine the last read that had valid information and store that in a shift register or something similar
0 Kudos
Message 4 of 4