Reputation: 313
Good afternoon.
In Windows 10 Enterprise, I have a COM1 device.
To send and receive data, I use the following code:
using (var serialPort = new SerialPort(SerialPort.GetPortNames()[0])
{
BaudRate = 9600,
Parity = Parity.None,
StopBits = StopBits.One,
DataBits = 8,
Handshake = Handshake.None,
ReadTimeout = 50000
})
{
serialPort.Open();
var inputBuffer = new byte[] { 1, 3, 8, 10, 4 };
var outputBuffer = new byte[inputBuffer.Length];
serialPort.Write(inputBuffer, 0, inputBuffer.Length);
serialPort.Read(outputBuffer, 0, inputBuffer.Length);
}
However, after reaching 50 seconds, a timeout error occurs in the "Read" method.
Questions:
P.S. Never worked with COM before.
Upvotes: 0
Views: 67
Reputation: 4350
There is no API that allows the Windows serial port to have a loopback function.
One of the following is possible.
Upvotes: 1