[Interest] QModbusTcpClient - More than one Modbus ID query in TCP Package

Pfeiffer, Stephan Stephan.Pfeiffer at binder-world.com
Tue Dec 20 08:45:35 CET 2016


Hello dear all,
I already wrote a post to the QT forum and got the suggestion to post my question at this site.
Currently I'm using the class QModbusTcpClient. I want to read sequentially values from different Modbus addresses. In a thread I'm calling the following function via signal slot.
void BModbus::requestRequiredSlot(BModbusData *data)
{
    QModbusDataUnit du(QModbusDataUnit::HoldingRegisters, data->address(), data->datatype().second);
    QModbusReply *reply = c->sendReadRequest(du,255);
    connect(reply,&QModbusReply::finished,this,&BModbus::readyReadSlot);
}
Everything is working fine if I poll one Modbus address.
The Wireshark Protocol says that only one query is placed in one TCP-package.
If I query more than one modbus address, then there are all modbus queries in one
TCP-package (also logged with Wireshark). And my device only sends an answer to the last ID in the package.
Can anyone help me so that the QModbusTcpClient packs every Modbus ID into a seperate TCP-package instead of all in one?
Thanks for your help!
________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161220/59aee82d/attachment.html>


More information about the Interest mailing list