05-27-2018 01:12 PM
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
05-27-2018 02:14 PM
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
05-27-2018 03:08 PM
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
05-27-2018 10:52 PM
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
05-28-2018 12:12 AM
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.)...
05-28-2018 12:36 AM
Yeah. I get that, Bob. I was just saying thanks.
05-28-2018 12:37 AM
Thanks for the info, advice, and link. Much appreciated.
05-28-2018 12:52 AM
@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:
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...