LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW and Bluetooth recommendations

    We are working on developing a new hardware product that will talk to an existing LabVIEW program. We have an EE creating the electronics, and he would like to use Bluetooth to send the data wirelessly to LabVIEW. Since we're early in the project, we have the relative luxury of being able to define how to make all this work. I'm wondering if anyone could share their experience along these lines and help point us in the right direction.

     I know that LabVIEW can open Bluetooth connections natively. My understanding of that option is pretty limited, but I assume that if our EE creates appropriate hardware, we could open a connection to it in LabVIEW and read and write data, using whichever protocols he chose.

     I would also guess that there are ways to create a virtual serial driver using a bluetooth connection. E.g. is there an existing 3rd party Windows driver that can connect to a Bluetooth device and make the data appear as if it is being sent to and from a serial port? In that case, from the LabVIEW side, we would just open the virtual comm port and handle it the same was as a real comm port. On the hardware side, the EE would need to use the appropriate protocol to talk to the Windows Bluetooth stack.

      There are probably additional approaches I'm not even yet aware of. Any suggestions would be appreciated, as would any clarifications on what I have attempted to describe above.

 

TIA,   DaveT

 

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 8
(2,773 Views)

There's a recent discussion about Bluetooth in the Forums here.  You can probably find other discussions by search the Forums with Bluetooth as a topic.  If you Learn Something Useful, post it as a Solution to your original Post.

 

Bob Schor

Message 2 of 8
(2,752 Views)

Thanks, Bob! I had looked for previous discussion, but hadn't found that one. It has a ton of potentially useful information for my situation - especially if I figure out that we can just use the Bluetooth-as-serial-port idea. (It's not a solution yet, in my case, but definitely worth a Kudos!)

 

DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 3 of 8
(2,744 Views)

I didn't intend to provide the Solution -- I expect you to "play around" with the hints provided by the referenced Post, figure out "how to do this", and then, yourself, post the Solution so that the next Forum User who wants to use LabVIEW Bluetooth will know how to do it.

 

Bob Schor

Message 4 of 8
(2,721 Views)

I would also guess that there are ways to create a virtual serial driver using a bluetooth connection. E.g. is there an existing 3rd party Windows driver that can connect to a Bluetooth device and make the data appear as if it is being sent to and from a serial port? In that case, from the LabVIEW side, we would just open the virtual comm port and handle it the same was as a real comm port.

 

Actually you do not need any specific driver under Windows to create a Bluetooth virtual serial port. You only need that the Bluetooth adapter driver is installed under Windows, then you can go through a manual pairing procedure under Windows, and finally create -also manually- a virtual serial port for the BT adapter (at the BT settings under Windows, there is usually a "COM Ports" TAB, where you can Add a virtual port).

 

Ok, now the question is that, are you satisfied with such manual setup for your application under Windows? I am not aware of any automatic way, I always went on the "install BT driver for Windows, pair devices, finally Add virtual com port" route. After a quick google I found this so far, where the developer just concluded it is not an easy thing to automatize this, so decided to use manual method: https://stackoverflow.com/questions/906454/accessing-bluetooth-virtual-com-port-on-windows-without-m...

 

For the serial com protocol I have the feeling you already know what are the tricks and best practices (usage of termination character, never using "bytes at port" node but let VISA Read wait, request/response type protocol, etc.)...

Message 5 of 8
(2,716 Views)

Yeah. I get that, Bob. I was just saying thanks.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 6 of 8
(2,710 Views)

Thanks for the info, advice, and link. Much appreciated.

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 7 of 8
(2,706 Views)

@Dave_Thomson wrote:

Thanks for the info, advice, and link. Much appreciated.


I think I would try to go on the .NET route, using the "32feet" library. Another post citing the above link is here: https://stackoverflow.com/questions/29445832/creating-a-bluetooth-com-port-on-windows-programmatical...

The OP at this link claims that he does not like the idea of iterating through all of the COM ports to find which one is the BT one:

Spoiler
thanks, but i had seen that link before. it is almost irrelevant. the final "close to answer" thing in that post is using a third party .net library, which doesn't handle serial over bluetooth very well. although the developer claims that he doesn't "like" serial over bluetooth, the real shortcoming of the 32feet library is that it cant tell you that name of the serial port! you can register a serial port over a bluetooth socket, but you must then find a magical way to guess it, like iterating over all the ports which is not elegant at all.

But hey, we do this all the time in LV! 🙂 You can just send a request to all present COM ports, and check the proper reply coming in, then you have it...

 

Here is the relevant part of this .NET library, but I have zero experience with its usefulness: 

https://github.com/inthehand/32feet/wiki/Bluetooth-Serial-Ports

 

Hey, and I have just found this too! 🙂 https://forums.ni.com/t5/Example-Program-Drafts/Pairing-Wii-Remote-quot-Wiimote-quot-or-any-bluetoot...

Message 8 of 8
(2,701 Views)