-1

In my project, there is an external device that is connected with my desktop with a serial port and passes data to its software. Now, I want to monitor that data and store it directly into .csv file. So, is there any method to capture that data from the currently used serial port and store in csv file?

I tried serial port functions provided by C#. But for that, I have to make a virtual port and then data comes into my software. But this method cannot handle any file format.

1 Answers1

0

As far as I know, there is no way to open a serial port that's been already open by another process.

I don't know exactly what you mean about not being able to handle any data format but this project (Serial Lab) seems to have what you want: sniffing using a virtual port, logging to CSV and it's written in C#.

Marcos G.
  • 3,371
  • 2
  • 8
  • 16
  • But there are third-party tools available, which can monitor your serial port communication. So there should some method for this. – Mashruwala Dhruvin Jun 10 '19 at 05:24
  • Yes, there are commercial tools. I might not be the best informed but as far as I know, all of those are based on a virtual serial port. The only tool I'm aware of that was ever free was Portmon from Sysinternals (which won't work on x64). Eltima, which is probably the best known seems to use a virtual device too... The only other choice you have is to use two additional serial ports and use a tool like Termite (or others if you have Linux) to forward them: https://stackoverflow.com/questions/56359916/use-serial-uart-output-as-input-in-other-serial-terminal-on-windows-10/56377015#56377015 – Marcos G. Jun 10 '19 at 05:42