472,146 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

SerialPort Control in VC# Express 2005


I have a problem with the SerialPort Control under VC# Express 2005.
In my application I have to read data from an external device through RS 232.
The process is built on a software-based handshaking which depends on the

The process has been implemented by me and works but unfortunately only the
first time.
All data are donwloaded successfully as required.
The process is simple serialPort11.Open(), Handshaking, Data Download,
Handshaking, serialPort1.Close().

The problem occurs with the second run, when the same procedure is executed
again (using a button_onclick event), then the Port is opened again with
serialPort1.Open() and with the first serialPort1.readByte() a TimeOut Error
Even if the Timeout is set to 10sec it does not help.

If the application is restarted and the process is again executed, then the
data are read perfectly from the device. Hence it does not depend on the
state of the external device, but on the PC (Soft and/or Hardware).

I have the feeling, that closing the SerialPort with serialPort1.Close()
does not free all resources and possibly the hardware RS232 is not fully

Has anyone had a similar problem and found a solution for it?
Can you rely on serialPort1.Close()? Are all resources freed?

I hope someone can help

Thanks a lot in advance
Best regards,


Jul 18 '06 #1
0 1321

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by seankub | last post: by
1 post views Thread by Richie Carey | last post: by
2 posts views Thread by Andrea Judge | last post: by
7 posts views Thread by Tamir.D | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.