cn_rdc
Posts: 18
Joined: Fri Aug 12, 2005 9:07 pm

Trouble Writing to Port

Wed Sep 05, 2007 8:30 pm

I'm able to use Franson Serial Tools to successfully read & write almost all the time. I'm using the PDA to write to a Bluetooth device. However, if the Bluetooth device goes out of range, the program hangs after attempting to Write to the Serial Port. Is there a way to trigger a timeout or cause Franson to return with some error code? Here's what I'm doing:
____________________________________________________________________

objPort.LicenseKey = xxxx
objPort.BaudRate = 460800
objPort.ComPort = 8
objPort.NoEvents = True
objPort.BufferSize = 8
objPort.Purge True, True
objPort.Enabled = True
objPort.TimeOut = 5000

'At this point if the device moves out of range
StrOut = objPort.Write("Hello") 'The program just hangs here
MsgBox "Return to the program" 'This never executes!

Sub objPort_OnTimeOut()
MsgBox "Does this show?" 'This never executes either!
End Sub
____________________________________________________________________

Thanks, in advance, for your help.

- Charles

User avatar
johan
GpsGate
Posts: 14392
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Trouble Writing to Port

Wed Sep 05, 2007 8:35 pm

The problem in this case is not SerialTools, it is the Virtual Port created by your Bluetooth stack.

To get better control over a Bluetooth connection, you can use BlueTools:
http://franson.com/bluetools

Regards,
Johan

Franson Support

cn_rdc
Posts: 18
Joined: Fri Aug 12, 2005 9:07 pm

RE: Trouble Writing to Port

Wed Sep 05, 2007 9:11 pm

Thanks for getting back to me, Johan. Does Franson BlueTools work with NS/Basic (I'm able to use Franson SerialTools with NS/Basic)?

- Charles

User avatar
johan
GpsGate
Posts: 14392
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Trouble Writing to Port

Wed Sep 05, 2007 9:13 pm

No, it is a .NET component.

Regards,
Johan

Franson Support

cn_rdc
Posts: 18
Joined: Fri Aug 12, 2005 9:07 pm

RE: Trouble Writing to Port

Wed Sep 05, 2007 9:24 pm

Thanks again, Johan. As I mentioned before, I'm really able to do almost anything with Franson Serial Tools & NS/Basic, except that I don't get a timeout. Is there some other way that Franson Serial Tools can return an error code or some other indication that it wasn't able to write successfully? Thanks for your prompt response.

- Charles

cn_rdc
Posts: 18
Joined: Fri Aug 12, 2005 9:07 pm

RE: Trouble Writing to Port

Thu Sep 06, 2007 1:19 am

Incidentally, Johan, I have no trouble when i 'Read' from the BlueTooth Port if the device goes out of range; the program just goes to the next line of code. However, 'Write' is another matter; the program freezes. Is there a way to return an error code or some other way to get back to the program. Thanks, in advance, for your help.

- Charles

User avatar
johan
GpsGate
Posts: 14392
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: Trouble Writing to Port

Thu Sep 06, 2007 4:07 pm

As previously said, the problem is the Bluetooth stack, it is the one that stops working.

Regards,
Johan

Franson Support

Return to “SerialTools”