I’m having a problem with the SerialPort class. We’re using multiple serialports in a generic list since we need to connect to multiple devices. This is what our basic code looks like: List<SerialPort> ports = new List<SerialPort>(); private void button1_Click(object sender, EventArgs e) { ports.Add(new SerialPort(“COM6”)); ports.Add(new SerialPort(“COM7”)); ports.Add(new SerialPort(“COM8”)); foreach (SerialPort port in ports) […]
Category: serial-port
SerialPort.Write() – How to stop writing?
I am developing in C# using the SerialPort class. SerialPort.Write() is a blocking method. How can I exit this method when I want to stop writing? I use a thread to write. I abort this thread when I want to stop writing but the COM port continues to write. Any ideas? Thanks a lot. Sorry […]