sshih
Posts: 1
Joined: Wed Mar 05, 2008 2:13 am

Port.Write not returning

Wed Mar 05, 2008 2:21 am

One of our clients is experiencing random lockup. I trace it down to the Port.Write(). The call does not return so the application appears hung up. Client can't kill the process with Task Manager if running as a Windows Service. If we run it as a console, yes client may kill the console window, but our application fails to start because the port does not exist. Here is the exact code to write a byte.

try
{
_port.Enabled = true;
return _port.Write(SerialNet.Port.ByteArrayToString(bytesToWrite));
}

The byte array is aways one byte long. We loop through an array of 15 bytes, write one byte, wait for 20ms, and write another.

We use 2.0.0.1. Thanks.

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

RE: Port.Write not returning

Wed Mar 05, 2008 9:37 pm

Hard to say if it is an hardware or driver issue or something else.

For easier debugging you can buy the source code here:
http://franson.com/serialtools/purchase.asp?license=source&platform=net

Regards,
Johan

Franson Support

WineGuru
Posts: 6
Joined: Tue Dec 19, 2006 3:57 am

RE: Port.Write not returning

Fri May 23, 2008 1:01 am

Same similar problem here. I have a bluetooth comport. 5 is incomming (not used) and 6 is outgoing. Connecting to 6 and talking to my remote instrument works fine but if I connect to 5, incoming, which one shouldnt need to, it disappears on the .write...never to return. Same as if the port wasn't there.

Tnx

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

RE: Port.Write not returning

Fri May 23, 2008 1:00 pm

Sounds like there is a bug in your Bluetooth software. I would recommend that you took a look at BlueTools SDK:
http://franson.com/bluetools

Regards,
Johan

Franson Support

Return to “SerialTools”