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. modbus component. a lot of crc errors.
Forum Updated to NodeBB v4.3 + New Features

modbus component. a lot of crc errors.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 447 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.
  • P Offline
    P Offline
    Pavel Romankov
    wrote on last edited by Pavel Romankov
    #1

    Hello.
    I use QModbusRtuSerialMaster class in my project.

    if (auto *reply
        = m_modbusDevice->sendReadRequest(QModbusDataUnit(QModbusDataUnit::Coils, 0x0004, 1), 1)) {
        if (!reply->isFinished()) {
            connect(reply, &QModbusReply::finished, this, [this, reply] {
                if (reply->error() == QModbusDevice::NoError) {
                   //logic
                } else {
                    qDebug() << reply->error();
                }
                reply->deleteLater();
            });
        } else {
            delete reply;
        }
    }
    

    And i have a lot of modbus errors like:

    qt.modbus: (RTU client) Discarding response with wrong CRC, received: 48379 , calculated CRC: 58176
    qt.modbus: (RTU client) Discarding response with wrong CRC, received: 63487 , calculated CRC: 26643
    qt.modbus: (RTU client) Discarding response with wrong CRC, received: 40447 , calculated CRC: 9460
    qt.modbus: (RTU client) Discarding response with wrong CRC, received: 60062 , calculated CRC: 49258
    qt.modbus: (RTU client) Discarding response with wrong CRC, received: 65511 , calculated CRC: 58230

    qt.modbus: (RTU client) Cannot match response with open request, ignoring
    qt.modbus: (RTU client) Cannot match response with open request, ignoring
    qt.modbus: (RTU client) Cannot match response with open request, ignoring
    qt.modbus: (RTU client) Cannot match response with open request, ignoring

    is it problem of connection or I need to check crc by myself?

    J.HilkJ 1 Reply Last reply
    0
    • P Pavel Romankov

      Hello.
      I use QModbusRtuSerialMaster class in my project.

      if (auto *reply
          = m_modbusDevice->sendReadRequest(QModbusDataUnit(QModbusDataUnit::Coils, 0x0004, 1), 1)) {
          if (!reply->isFinished()) {
              connect(reply, &QModbusReply::finished, this, [this, reply] {
                  if (reply->error() == QModbusDevice::NoError) {
                     //logic
                  } else {
                      qDebug() << reply->error();
                  }
                  reply->deleteLater();
              });
          } else {
              delete reply;
          }
      }
      

      And i have a lot of modbus errors like:

      qt.modbus: (RTU client) Discarding response with wrong CRC, received: 48379 , calculated CRC: 58176
      qt.modbus: (RTU client) Discarding response with wrong CRC, received: 63487 , calculated CRC: 26643
      qt.modbus: (RTU client) Discarding response with wrong CRC, received: 40447 , calculated CRC: 9460
      qt.modbus: (RTU client) Discarding response with wrong CRC, received: 60062 , calculated CRC: 49258
      qt.modbus: (RTU client) Discarding response with wrong CRC, received: 65511 , calculated CRC: 58230

      qt.modbus: (RTU client) Cannot match response with open request, ignoring
      qt.modbus: (RTU client) Cannot match response with open request, ignoring
      qt.modbus: (RTU client) Cannot match response with open request, ignoring
      qt.modbus: (RTU client) Cannot match response with open request, ignoring

      is it problem of connection or I need to check crc by myself?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Pavel-Romankov what version of Qt ? and are you sure the slaves calculates the correct CRC?

      Can you verify with a 3rd party tool ?


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pavel Romankov
        wrote on last edited by
        #3

        Qt 5.11.3
        I receive data from different devices and problem is everywhere.

        1 Reply Last reply
        0

        • Login

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