Results 1 to 3 of 3

Thread: QModbusClient: all subsequent modbus requests fail once a request had timedout

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Location
    Dresden, Germany
    Posts
    81
    Thanks
    9
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QModbusClient: all subsequent modbus requests fail once a request had timedout

    Hi there,

    got a quick question about QModbusClient / QModbusDevice.

    I'm using
    Qt Code:
    1. QModbusReply * QModbusClient::sendReadRequest(const QModbusDataUnit &read, int serverAddress);
    To copy to clipboard, switch view to plain text mode 
    to send out modbus requests to a (successfully) connected device. When the modbus data unit is configured correctly, this works well and I can retrieve several registers one after another by sending a request and processing the reply.

    When I send a request to a non-existing register (either due to configuration failure, or if the modbus hardware was configured differently), I will get a timeout on the request. This is to be expected and not problematic.

    However, when afterwards a request is sent to a correctly configured register, this will also result in a timeout.

    Example sequence:

    - read register 30201 -> success
    - read register 30230 -> timeout (register 30230 does not exist)
    - read register 30201 -> timeout (why????)


    I didn't find anything in the documentation (e.g. about clearing the error flag on the QModbusDevice or else).

    Does anybody have an explanation or pointer to some overlooked part in the docs? Or maybe this is a bug?

    Thanks for any ideas!
    -Andreas
    Andreas

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,325
    Thanks
    36
    Thanked 1,527 Times in 1,478 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QModbusClient: all subsequent modbus requests fail once a request had timedout

    I haven't worked with this part of the API myself, but in general with cases such as this it is often most useful look into the code itself.

    Usually the most efficient way to do that is to look for the class that is your entry point at the Woboq Code Browser.

    For example here QModbusClient and then following the method that is being called.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2006
    Location
    Dresden, Germany
    Posts
    81
    Thanks
    9
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QModbusClient: all subsequent modbus requests fail once a request had timedout

    Hi all,

    just for your info. After updating to Qt 5.11.3 I cannot reproduce this issue anylonger. QModbusClient works fine now - i.e. even after timeout of a bad request the next valid request goes through as expected.

    -Andreas
    Andreas

Similar Threads

  1. Qt Modbus Slave Example
    By qAlexey in forum Newbie
    Replies: 0
    Last Post: 25th July 2017, 19:36
  2. Qt Creator calling sudo qtcreator creates subsequent problems
    By feraudyh in forum Qt Tools
    Replies: 0
    Last Post: 16th July 2017, 14:47
  3. Replies: 0
    Last Post: 22nd October 2012, 12:39
  4. Modbus implementation
    By ShamusVW in forum Qt Programming
    Replies: 14
    Last Post: 21st December 2011, 10:32
  5. Replies: 0
    Last Post: 21st September 2010, 10:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.