LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble connecting Bluetooth VI Example to Bluetooth Scale

Development Plan

 

I plan to develop an NI LabVIEW Application that will acquire the weight data from the bluetooth scale interactively with Operator input and populate a Spreadsheet into the appropriate Row and Column.

Initial Development Work

 

Yesterday I followed the Mettler-Toledo "bluetooth pairing procedure" between our XP Scale and our laptop PC using the Belkin Bluetooth USB Adapter and I got them to connect, pair up and communicate with the scale using the Hyper terminal example at the end of the procedure. To achieve this, I had to load the Belkin Bluetooth Software to configure the Bluetooth connections etc. I then created a virtual COM Port using the SPP Profile and the Connection properties showed an average or "good" signal strength. I was also successful in making a bluetooth connection to the scale using the internal bluetooth wireless of the laptop. As soon as I issued the "SIR" command then the balance continuously sent the weight values non stop to the Hyper Terminal session and did not lose the bluetooth connection (ran for ~ 10 minutes then I disabled the connection manually).

 

Current Debug Work

 

I tried to connect to the scale using each of these Bluetooth VI Examples (Simple Bluetooth Client.vi, Simple Bluetooth Server.vi, and Advanced Bluetooth Client.vi, Advanced Bluetooth Server.vi) but got the following error message....

 

"Error 1 occurred at Bluetooth Create Listener in Simple Bluetooth Server.vi - Possible Reasons: LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @".

 

Will LabVIEW be able to acquire the data directly thru the use of a virtual COM Port or will it have to extract it from a Hyper terminal Telnet Session ?

 

With a bit of help, will the above Bluetooth VI examples connect to the scale properly or do I need a basic bluetooth read and write VI written to achieve this ?

0 Kudos
Message 1 of 19
(6,310 Views)

If you have configured your Bluetooth device to communicate through a virtual COM port, you could try using the VISA VIs and not the Bluetooth VIs. I would start with the Basic Serial Write and Read.vi.  There can be some caveats about using the VISA VIs with virtual COM ports, but hopefully you won't run into these.

Please give this a try and let everyone know if it worked or not.

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 2 of 19
(6,274 Views)

I tried connecting to the Bluetooth Scale using the "Basic Serial Write and Read.vi" but it failed to connect with the following error message....

 

"Error - 1073807202 occurred at Property Node (arg 1) in VISA Configure Serial Port (Instr).vi->Basic Serial Write and Read.vi. Possible Reasons: LabVIEW: (Hex 0xBFFF009E)VISA or a Code library required by VISA could not be located or loaded. This is usually due to a required driver not being installed on the system."

 

I tried refreshing the COM Port list but only COM1 and COM2 were listed so I typed in COM5 for the virtual COM Port I am using but I still got the same error as above. Based on the error message, it looks like there is a file missing, can you tell me which one ?

 

Thanks !

 

Barry

 

0 Kudos
Message 3 of 19
(6,258 Views)

Hi Barry,

 

According to this article you are most likely missing the NI-Serial and/or NI-VISA driver.  You can find the NI VISA driver here and theNI Serial driver here.  Please try installing this and let me know if the problem goes away or not.

Justin Parker
National Instruments
Product Support Engineer
0 Kudos
Message 4 of 19
(6,232 Views)

Hi Justin,

 

I installed the complete Device Driver Software and my problem is now fixed ! Using MAX, NI-VISA recognized all of the com ports including virtual COM Port 5 used for the Bluetooth Scale.

 

Thanks very much for your help !

 

Barry

 

0 Kudos
Message 5 of 19
(6,205 Views)

 hi biernaskieb 

 

you mean u have a module and you used VISA vi's to set the port without  paring ???? and if you can find the port number like COM6 you can get the data from it using the basic  read and write serial port vi's??

 

Regards 

 

0 Kudos
Message 6 of 19
(6,105 Views)

There are a couple of pre-requisite's required before you can start using the "Basic Serial Write and Read.vi"......

 

1.) You have to configure your Bluetooth device to use a Virtual Com Port. I installed my Belkin Bluetooth USB Adapter Software which then allowed me to configure a SPP (Serial Port Profile) for the Bluetooth Scale Device I am using. In this Profile I configured COM Port 5 (Outgoing) and COM Port 6 (Incoming) for bi-directional communucation. Once configured, I put the scale into "Host" Mode then executed the "pairing" feature which then paired successfully between the scale and the laptop PC. This creates a permanent COM Port 5 Session in your Bluetooth Places.

 

2.) I tested this Communication link first using the Belkin Bluetooth USB Adapter and a Hyperlink Telnet Session (COM Port 5) and issued appropriate commands to the scale and got the appropriate responses. I then did the same thing except using the Bluetooth Wireless built into the laptop.

 

3.) I then closed the Hyperlink Telnet Session and then used the "Basic Serial Write and Read.vi" and issued appropriate commands to the scale and got the appropriate responses.

 

I hope this helps in solving your problems as well !

 

Barry

 

0 Kudos
Message 7 of 19
(6,094 Views)

I recently purchased a DLINK DBT-120 bluetooth adapter.  I installed the windows only drivers (not the cd) as per How Do I Make a Bluetooth Device Work with LabVIEW?

I am running labview 8.2 on a windows XP sp2.

 

Initially I tried to run the simple bluetooth client/server, and I come up with the same error as the original poster "Error 1".

Seeing that I installed the drivers as described above....

 

How do I go about creating a Virtual Communication port for an SPP profile? 

(I am assuming by inserting and installing the DLINK cd, but wont that mess the drivers up?)

 

 

My Devices view on the computer:

17151i1A7CFA0429F5F8BD

 

 

 

Thanks for your time.

jqm

0 Kudos
Message 8 of 19
(5,670 Views)

oh, forgot to add I am running:

 

 

NI-VISA   V4.0

NI-Serial  V3.1.0

 

jqm

0 Kudos
Message 9 of 19
(5,668 Views)

Hello jqm,

 

Now that you have configured your Bluetooth Adapter, you should now be able to configure an SPP Profile using this new adapter. You should be able to do this either of two ways.........

 

1.) Via Device Manager, double click on your new Bluetooth Adapter under Bluetooth Radios

 

OR

 

2.)  Via the bottom right side of your Toolbar, double click on the Bluetooth Icon

 

This should open the Bluetooth Control Panel, in there should be 4 tabs (Devices, Options, Com Ports and Hardware). You then have to configure each tab appropriately as per the Device and Com Port you are going to use.

 

If you still can't open the Bluetooth Control Panel, you should be able to right click on the Bluetooth Icon and you should be able to select Properties or Bluetooth Configuration that will allow you to configure your Bluetooth Adapter.

 

Attached is a good reference Document I used to help me configure my Bluetooth SPP Profile that works great. The section to reference is called Section 4 - The Bluetooth Control Panel.

 

Good Luck and let me know how you fair out !

 

Barry

 

0 Kudos
Message 10 of 19
(5,641 Views)