Page 1 of 1

Port.Write not returning

Posted: Wed Mar 05, 2008 2:21 am
by sshih
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.

RE: Port.Write not returning

Posted: Wed Mar 05, 2008 9:37 pm
by johan
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

RE: Port.Write not returning

Posted: Fri May 23, 2008 1:01 am
by WineGuru
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

RE: Port.Write not returning

Posted: Fri May 23, 2008 1:00 pm
by johan
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