LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

COM ports associated with Bluetooth

Hi all,
 
I have a problem related to COM ports created by Bluetooth devices. When installing a BT device on the PC, a pair of COM ports are created (I think thay are called virtual COM ports). One port is for incoming communication and one is for outgoing communication.
My problem is this: 
 
When I do a VISA open on the outgoing COM port there is a delay for between 5 and 35 seconds before the VISA Open returns to my VI and then it returns with an error (0xBFFF0000, unknown system error). When the VISA Open is called, my mobile phone requests that I either accept the connection or reject it (this is standard BT behaviour, I think). If I do not respond on the mobile, it takes up to 35 seconds before the VISA Open returns and i can read the error code. If i respond at once, VISA open returns and there is no error. Now I reason that I can use the timeout input to specify a maximum time I want to wait for response (the phone may be off), but this does not work (at least not when the COM port is associated with BT).
 
I have attached an VI that illustrates how i measure the VISA Open execution time. If I specify 200 ms in the timeout, the VISA open does not return after 200ms but after 5-35 secs, depending on wether the mobile is turned on or not.
 
Can somebody help wih this problem? I am not interrested in letting my application delay for that long if BT is installed on the computer.
My application does not actually use the BT port, but simply need to identify the com port as a BT port and not use it.
 
I am using LV 7.1 on WinXP SP2.
 
regards,
Thomas Bay
0 Kudos
Message 1 of 3
(2,961 Views)
Hi Thomas,
probably the information you are searching for is buried into the registry. There was a useful vi by unclebump here:

http://forums.ni.com/ni/board/message?board.id=170&message.id=143153&view=by_threading&page=1

Values obtained from bt ports are probably different from any other. Try on your system.
Of course, this is not a general method, but I hope it's enough for you.

Paolo

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 3
(2,956 Views)
Thanks, Paolo
It solves my problem to use the registry to identify COM port candidates. Now I only use COM ports identified by a \Device\Serial? or \Device\VCP?in the SERIALCOMM\ section of the registry.
One thing puzzles me, though. And that is that one brand of my USB/RS232 converters install itself using a VCP? key and he other as a Serial? key (I think the VCP stands for Virtual Com Port). I am not that much into windows registry, so I think that I will consult another forum to get an answer to this.
Thanks again for you help.
 
Thomas
0 Kudos
Message 3 of 3
(2,929 Views)