Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Monitor serial port

Monitor serial port

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Feiderico.Massimi
    wrote on 15 Jan 2020, 11:45 last edited by
    #1

    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.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mostefa
      wrote on 15 Jan 2020, 12:36 last edited by
      #2

      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

      1 Reply Last reply
      1
      • A Offline
        A Offline
        artwaw
        wrote on 15 Jan 2020, 12:49 last edited by
        #3

        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.

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        5
        • F Offline
          F Offline
          Feiderico.Massimi
          wrote on 16 Jan 2020, 08:29 last edited by
          #4

          @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?

          A 1 Reply Last reply 16 Jan 2020, 08:34
          0
          • F Feiderico.Massimi
            16 Jan 2020, 08:29

            @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?

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 16 Jan 2020, 08:34 last edited by
            #5

            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

            Qt has to stay free or it will die.

            1 Reply Last reply
            4
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on 16 Jan 2020, 09:12 last edited by
              #6

              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 Reply Last reply
              5

              1/6

              15 Jan 2020, 11:45

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved