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. Question about QModbusRtuSerialMaster
Forum Updated to NodeBB v4.3 + New Features

Question about QModbusRtuSerialMaster

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 124 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.
  • W Offline
    W Offline
    wangyun
    wrote on last edited by
    #1

    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,please

    QModbusDataUnit 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";
    }
    
    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