Read command



  • Hi,
    I'm studying Modbus server example. I need to captare the read command of modbus master, but I don't understand how I can do it. I need to do this because I have to discriminate the write command from the read command. The qt example doesn't show how do this. I saw that there is a writen signal about client write command, but there isn't a read signal. I'm working with qt 5.8.

    Can someone help me, please?

    Many thanks in advance.

    Best regards,
    Chobin



  • @Chobin
    although I'm not familiar with modbus.
    but isn't dataWritten signal enough to discriminate read and write request?

    or you have some reason that you need to know the client sends a read request?



  • Hi,

    I need to know when the client sends a read request because in this situation I have to cancel some parameters.

    If I set a breakpoint in the dataWritten signal handler: the software stops there when the client sends a write request, but when it sends a read request the software doesn't stop so I can't implement anything.

    I don't understood if it's possible to create an object to read the request type.

    Please, help me.

    Thank you,

    Chobin



  • @Chobin
    I think maybe subclass QModbuServer and reimpliment QModbusServer::processRequest or QModbusServer::processPrivateRequest can meet your need


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.