tags:

views:

31

answers:

1

I have a situation where I need to collect logs for the process that happens. So If process1 happens, log1 should start, same with process2 and log2. Both run at the same time. So ideally, i should get log1 and log2 updaating along with the progress at the same time.

My problem is, If i run process1, log1 starts, but when i start, process2, then log1 stops and log2 for process2 starts. If I start process1 at 10, logs happen, but wn I start process2 at 10.10, log1 stops at 10.10 and a new log2 is created from 10.10 onwards..

This is my code:

if (CommsPort != 0)
{
   SPort = new SerialPort("COM" + CommsPort.ToString(), 9600, Parity.None, 8, StopBits.One);
   SPort.Open();
}
A: 

Only one process can open a COM port at any one time. You'll have to make the processes cooperate with some form of IPC.

Bob Moore