modbus component. a lot of crc errors.
-
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: 58230qt.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, ignoringis it problem of connection or I need to check crc by myself?
-
@Pavel-Romankov what version of Qt ? and are you sure the slaves calculates the correct CRC?
Can you verify with a 3rd party tool ?
-
Qt 5.11.3
I receive data from different devices and problem is everywhere.