Congratulations to our 2022 Qt Champions!

Using QModbusPdu

  • Hello,
    I have a QByteArray with a pdu struct (i.e. function code and needed data). I can create a QModbusPdu instance with this data but always isValid=true... I have used QModbusRequest but has the same behaviour.

    Is there any way to check if in QByteArray are a valid modbus command? My way is using QModbusPdu::decodeData and check if there are expected fields according to the function code. But, is there other way using Qt modbus classes?


Log in to reply