Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

PDA bluetooth programming in VB2005

Hello,

I'm trying to write a PDA program in VB2005 that communicates with and records data from a data acquisition (DAQ) system via bluetooth (BT), but I've run into a strange connection/communication problem.

After reading Wei-Meng Lee's Programming Serial Ports Using VB2005 (http://www.dev-archive.com/dotnet/Article/31001/0). I was able to create a simple desktop application that successfully setup a BT connection with the DAQ and could send it a few commands. Then, I wrote code for the PDA that was pretty much identical-- the only serial port functions I used were IsOpen, Write, and Close. but here's what happens:

When I run the VB PDA program, it seems like the PDA-DAQ BT (virtual COM)connection sets up OK, but the DAQ doesn't respond to any of the commands I send (write to) it. However, if I disconnect and then open a new PDA-DAQ BT connection, the last command I sent in the original connection executes. This will even happen if I make the reconnection with the Bluetooth Manager after the VB PDA program is shut down.

Any ideas what I might be doing wrong?

I'm using MS Visual Studios Standard Ed and a Dell Axim X50 with Windows Mobile 2003 Second Edition.

thanks in advance,
Luan
[1295 byte] By [Luan] at [2007-11-11 8:51:06]
# 1 Re: PDA bluetooth programming in VB2005
Luan,

1. Check what line terminator the DAQ device expects in the messages, ie just a CR or CR + LF characters, or something else?

2. Check the state of your control lines at the DAQ using a breakout box (assuming you can insert it between the serial port and the bluetooth device - likely not if you're using USB adapter at the DAQ end). The breakout device box will show you (a) whether you're getting any characters transmitted at the DAQ end as well as characters received. Even better would be a serial analsyer but you may not have access to one of those.

Eric
eapperley at 2007-11-12 0:15:31 >