Monitor serial port
-
wrote on 15 Jan 2020, 11:45 last edited by
hi, I would like to create a small software that can monitor data from ant to serial port.
In practice I have a hardware device that communicates with its software through the serial port, I would like to create a small tool to log (bidirectional) this communication.
I tried with QSerialPort, but if I try to open a serial port that is already in use by another software it gives me an error.
Can anyone help me?Thanks in advance.
-
wrote on 15 Jan 2020, 12:36 last edited by
Hi,
You might be interested with this page of qt serialport example:
https://doc.qt.io/qt-5/qtserialport-examples.html
I think that this one :
https://doc.qt.io/qt-5/qtserialport-terminal-example.html
should do what you need,
These examples are directly available from qtcreator: Welcome ==> examples
I hope this can help you
-
wrote on 15 Jan 2020, 12:49 last edited by
Serial port is always opened in exclusive mode, you can't just listen to it without interruption. You could, in theory, design your system to read from one serial port and immediately forward raw data to another but that would require two serial ports and would introduce minimum delay.
Without further info I can't advise you more. -
wrote on 16 Jan 2020, 08:29 last edited by
@artwaw Yes, I know that the serial ports are open in exclusive mode.
But I have seen that various software exist, like these:
Free Serial Analyzer
Serial Port Monitor
COM Port Monitoring
that they do exactly what I need, I tried them and they work even if the serial port has been opened exclusively by another software, so how does this work? -
@artwaw Yes, I know that the serial ports are open in exclusive mode.
But I have seen that various software exist, like these:
Free Serial Analyzer
Serial Port Monitor
COM Port Monitoring
that they do exactly what I need, I tried them and they work even if the serial port has been opened exclusively by another software, so how does this work?Hi @Feiderico-Massimi,
These programs intercept O/S API functions to get their work done. This is not possible with QSerialPort, and surely not an easy task.
Regards
-
These programs intercept O/S API functions to get their work done.
Yes, they are use own 'filter' drivers on Windows which are intercepts all I/O from the device. They even does not open a serial ports, they just cling to some layer of a drivers stack.
1/6