03-08-2010 01:46 PM
Support,
I have recently completed most of my development, debug and verification of my Bluetooth Application which basically connects to a Scale via an internal Wireless Bluetooth Connection option and records all of our immersion density weights into a spreadsheet interactively with the Operator.
One major problem that still lingers is one that intermittently happens ~ 7/10 times at startup. When the Wireless Bluetooth Mode is turned "ON" at the laptop and the appropriate Virtual COM Port is selected "COM6", the SPP (Serial Port Profile) is then connected to COM6 and the scale is ready for Communication. When the Bluetooth App fails to accomplish this after several attempts, the only way to make the connection to COM 6 is either of two methods. One is opening "Bluetooth Places", select the appropriate Balance based on the Address or COM Port and then select "Connect". The other method is by right clicking on the "Bluetooth Icon" found on the taskbar and select "Quick Connect->Bluetooth Serial Port->Balance XX:XX:XX:XX:XX:XX". Attached are some snapshots to illustrate some detail of these methods.
My questions is, can either of these methods be implemented into my LabVIEW Bluetooth App via some sort of custom Bluetooth VI or via an Active X VI ? If so, are there any examples that I can use for implementation ?
Thanks !
Barry
03-09-2010 12:55 PM
Hi Barry,
Since this is only failing some of the time, that suggests to me that it might be something of a race condition. In other words, there are two things that are running simultaneously, and sometimes task A finishes first, and sometimes task B finishes first. In this case, task A is the bluetooth service being initialized by Windows, and task B is your VI which is trying to establish communication via Bluetooth. If you try to establish communication before the service is initialized, you see the problem you have been observing. To fix this, I would put a wait somewhere in the code to allow Windows the time to start the Bluetooth service before trying to connect to it.
If this doesn't work, you might be able to do this with ActiveX. It all depends on whether or not there is an ActiveX server that is for Bluetooth configuration. If there is, you can call it through LabVIEW. If not, you can't. I am not sure if Windows publishes this as an ActiveX server or not.
03-11-2010 12:03 PM
Hi Wes,
I will followup with MicroSoft to see if there is support for Active X Server for Bluetooth.
Meanwhile, I will try to debug my problem further by inserting some wait times or delays into the code to see if it helps or not.
Thanks !
Barry
03-12-2010 10:36 AM