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: 

How to wait and connect to a BlueTooth peripheral when it powers up ?

Solved!
Go to solution

I have a requirement to connect to two Blue Tooth peripherals - one at a time - based on specific requirements.

 

The peripherals are simple HC05 / 06 modules connected to an Arduino each. 

 

The attached code does this function well - though i am not sure if this is the right way to do it ! ( This is just sample code only for the BT. Otherwise there are lot more functions to handle ) 

 

But i have a problem : For this to work it is essential that both the peripherals are powered before i start the VI. This is not how it will be in real time - both the peripherals are battery powered and i cannot afford to keep them powered indefenitley !! 

 

What i want to do is : Start the BlueTooth server on the VI and leave it running and link up when the peripheral comes on line. After all this is how all cell phones work - once the BT is enabled, it connects to any paired peripheral when it is powered. 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 4
(2,637 Views)

Hmmm... I see that the outer loop is a stupid idea. Will remove it and work on a single loop with both BT instances inside that with selective calling and restarting when the Error node returns a fault. 

 

Maybe a shot of Scotch will help !! 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 2 of 4
(2,602 Views)
Solution
Accepted by topic author MogaRaghu

Ok so the issue is resolved. 

The attached VI will do all what I planned to :

1. Selectively connect / disconnect to a BT Module that is sending data based on a FP switch.

2. If the User clicks Connect without powering up the module it tries to connect once every 5 seconds without throwing a fault.

3. If the BT module goes off line when connected, the code tries to auto reconnect once every 5 seconds. 

( The BT module was a HC05 driven by a Arduino Nano PCB sending millisecond data once every 100ms ) 

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 4
(2,588 Views)

bonjour, je peux vous contacter pour savoir comment vous avez fait la communication bluetooth hc05 avec labview 

0 Kudos
Message 4 of 4
(1,554 Views)