LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically reconnect Bluetooth

Solved!
Go to solution

Hi, I have a vi which connects to a Bluetooth transceiver, and collects and plots/saves the incoming data. The connection is initiated by the user on the front panel.  However, sometimes LabVIEW gives me a connection error, sometimes it's once an hour, sometimes it's once every 24 hours, and I have to manually initiate the connection.  I was wondering if there is a way to design a vi which is always searching for a connection, so when the connection gets interrupted it automatically reconnects.  I see that there are sample Bluetooth vis that come with LabVIEW (2010), would any of these work?

0 Kudos
Message 1 of 6
(4,740 Views)

In addition to this, I have one more question.

 

Can someone explain to me what the difference between using the Bluetooth Open Connection Function and the Bluetooth Create Listener Function/Bluetooth Wait On Listener Function? In addition to keeping the connection open, I would like to extend this vi to connect multiple BT devices, say 3, to one program. If I know the address of all three, I was thinking just use 3 Open Connection functions, however I feel there is a better  way to do this? 

0 Kudos
Message 2 of 6
(4,717 Views)
Solution
Accepted by topic author baseball07

Hi baseball07,

 

The "Advanced Blueooth Server.vi" example (go to Help > Examples > Search bluetooth, and it should show up in the list) should be a good place for you to start. It shows how to connect to multiple listeners at the same time, using the Create Listener function.

 

As well, it shows how to use the Bluetooth Wait on Listener function. In this example VI, if you catch a Connection Timed Out error or a Connection Closed error, you stop the loop and close. You could modify this so that if you recieve this error you create a flag to show that a disconnect has occurred, but instead of stopping continue the outer while loop to go back to the Bluetooth Wait on Listener state. As long as the device it still trying to connect, you should be able to automatically reconnect to the bluetooth device.

 

I hope this helps!

Emily C
Applications Engineer
National Instruments
Message 3 of 6
(4,683 Views)

Hai, i want to ask about bluetooth in labview. I use bluetooth device HC-05 with arduino. Then i want to connect the input from reading of bluetooth device. What i want to know, i dont get the data in labview and have error at bluetooth create listener and bluetooth wait on listener. and i dont know what is format of uuid connected with bluetooth create listener.

 

Can you give me how to connect the data from device to labview and can display the result?

 

I try using the simple bluetooth in Labview.

0 Kudos
Message 4 of 6
(4,501 Views)

Hello Fiza,

 

Thank you for your question about Bluetooth features in LabVIEW. Your questions are many, but I have included some KB articles that may directly answer your questions. Also, are you using the Bluetooth Toolkit? If not, you may want to check it out!

 

I would also recommend that you post your code for others to review as well (if you are willing and able to do so).



This article outlines how to create a listener and discusses uuid question that you had:

Bluetooth Create Listener



This article Forum post discusses the data acquisition:

Bluetooth Data Acquisition

 

I hope that these articles help you as you develop your project.
 

Warm Regards,

Josh
0 Kudos
Message 5 of 6
(4,474 Views)

Hai,


I hv problem with Labview interface with Arduino. i didnt get result on Labview display. Before this i use Labview hacker with LINX, but i cant use it because i should use bluetooth application (HC-05) and not in serial usb. i should send data using bluetooth.

 

What i want to know, if i use SPI and I2C, what the suitable coding can be use and can display data in Labview GUI via bluetooth. i need your help about coding and labview.

 

Many thanks if u can help me..

0 Kudos
Message 6 of 6
(4,408 Views)