I have two Conexant fax modems, and a C# app with two serialPort objects setup to listen for incoming data on both comm ports.
Here is how I initialize each modem:
m_SerialPort = new SerialPort("COM3", 2400);
m_SerialPort.DataReceived += new SerialDataReceivedEventHandler(this.ReceiveChars);
try
{
m_SerialPort.Open();
m_SerialPort.DiscardInBuffer();
m_SerialPort.DiscardOutBuffer();
}
catch (Exception e)
{
// die gracefully
}
finally
{
m_SerialPort.DtrEnable = true;
}
And the second modem is initialized to a different SerialPort object but with "COM4".
Whatever COM port I initialize first can receive data, but the second COM port will not receive data.
Is this a problem with my initialization, C#'s SerialPort class, or Windows XP refusing to let two modems operate at the same time?
Any advice or suggestions are welcome.
UPDATE
Have you checked under "Device Manager" that both ports are configured, enabled and working?
Yes, they are both there with seperate ports.
Have you tried something like Hyperterm to try and send data to the ports?
Tried opening both comm ports in separate hyper terminals, and failed to open the second comm port.