Question about QModbusRtuSerialMaster
Unsolved
General and Desktop
-
My QT version is 5.13.1,I use the QModbusRtuSerialMaster class to send the read request ,When I call sendReadRequest function ,the QModbusReply object can not smit finished signal,and the slot can not work.
I use softwore "Modbus Slave" to see the data sent and received. This is my code,help me,pleaseQModbusDataUnit MbDataUnit(QModbusDataUnit::HoldingRegisters, 0, 2); pMbReply = pMbSerialClient->sendReadRequest(MbDataUnit, 1); if (pMbReply != nullptr) { if (pMbReply->isFinished()) { delete pMbReply; pMbReply = nullptr; } else { connect(pMbReply, &QModbusReply::finished, this, &Qt_ModbusSerial::on_MbSerialClient_readFinished); } } else { qDebug() << "pMbReply is nullptr"; }