Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87265

QSerialPort strange behaviour with 7561

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.14.2
    • None
    • Windows 7 x64 Qt 5.14.2 msvc
    • Linux/X11, Windows

    Description

      QSerialPort has strange behaviour with ICP DAS I-7561.

      For example i compare raw com port (ICP DAS I-7520) with how it works through virtual com port

      ICP DAS I-7561

      Sent 8 bytes: "01" "04" "00" "01" "00" "1e" "21" "c2"
      Received 12 bytes: "01" "10" "02" "a2" "00" "84" "00" "00" "a0" "00" "43" "00"
      Received 12 bytes: "0e" "00" "28" "04" "00" "1e" "24" "54" "48" "c2" "39" "26"
      Received 15 bytes: "d3" "02" "11" "19" "2a" "26" "20" "54" "00" "50" "30" "50" "24" "62" "95"
      Received 6 bytes: "20" "56" "00" "00" "b5" "f1"

      ICP DAS I-7520

      Sent 8 bytes: "01" "04" "00" "01" "00" "1e" "21" "c2"
      Received 32 bytes: "01" "04" "3c" "00" "a2" "00" "00" "00" "84" "00" "00" "00" "00" "02" "01" "00" "0d" "01" "00" "00" "0e" "00" "00" "08" "19" "00" "00" "00" "1e" "00" "24" "51"
      Received 33 bytes: "0d" "32" "38" "39" "33" "36" "37" "60" "04" "19" "53" "90" "02" "20" "51" "00" "00" "04" "01" "30" "04" "19" "22" "6c" "e5" "20" "59" "00" "00" "00" "00" "ab" "15"

       Here is how i receive

       

      QByteArray ba;
      QDebug debug = qDebug(); 
      while (Port->bytesAvailable())
        ba += Port->readAll();
      debug << "Received" << ba.size() << "bytes:";
      for (const quint8 &byte : ba)
      {
      QString number = QString::number(byte, 16);
      if (number.size() == 1)
        number.prepend('0');
      debug << number;
      }
      

       It looks strange because i receive not the same data but if try to sniff this between device and pc it looks the same. So i think it depends on QSerialPort.

      Anyway i tried the same with libmodbus as backend and i didnt use QSerialPort for communication. This works.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            atom-tc Anton 0xNULL
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes