Results 1 to 9 of 9

Thread: Libmodbus + QT

  1. #1
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Libmodbus + QT

    Hello.
    I want to write an application - Modbus Slave.
    The application is to have an array of data that will provide the Modbus protocol. The data for the array will fetch the object editline.
    Traced libmodbus library documentation but I can not find an example.
    http://manpages.ubuntu.com/manpages/...bmodbus.7.html
    Please help me.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Libmodbus + QT

    http://www.libmodbus.org/documentation

    On Ubuntu the include and library files are probably in standard locations so:
    Qt Code:
    1. LIBS += -lmodbus
    To copy to clipboard, switch view to plain text mode 
    in your PRO file should do.

  3. #3
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Libmodbus + QT

    I want to write a program - Modbus TCP / IP server (slave).
    The program is to execute the task:
    1 Take data from the array
    2 Enter them in the records Holding Registers.
    3 Share the Modbus protocol (to master to read them).

    How to do it?
    I need an example.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Libmodbus + QT

    You could read the unit tests supplied with libmodbus. There are complete client and server examples in C. Beyond that you need to ask in a libmodbus or Modbus forum because your questions have nothing to do with Qt.

  5. #5
    Join Date
    Mar 2013
    Location
    Poland
    Posts
    15
    Thanks
    2
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: Libmodbus + QT

    I solved this problem. thx.

  6. #6
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Libmodbus + QT

    Hi! If someone is interested in non-blocking modbus client using libmodbus, just recently I wrote some wrapper - https://github.com/Krzysztow/qtLibModbus .

    Here the execution of requests is performed in a new thread in FIFO manner. So far some files are pulled out straight from libmodbus, but if anyone is interested, I will make it possible to link with library. If anyone has any objections regarding this piece of code, I would be more than happy to hear them.


    Cheers,
    Krzysztow.

  7. #7
    Join Date
    Feb 2014
    Posts
    10
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Libmodbus + QT

    Krzysztow,

    I couldn't managed to set up a project with your wrapper, I have to say that as this needs to be under windows, I couldn't also have the libmodbus compiled anyway while I have used mingw32 to do this.

    ARe there guidelines to have a simple project using this please?

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Libmodbus + QT

    If you have not been able to compile libmodbus on Windows then you will not be able to use Krzysztow's Qt wrapper for that library. Requirements for building libmodbus using MingW are in the libmodbus readme file: the process is very similar to a UNIX machine when the requirements are present.

  9. #9
    Join Date
    May 2015
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Libmodbus + QT

    Hi,

    I am new to Qt and raspberry pi application development and want to use 'Modbus code provided by libmodbus' in my application to do fast development.

    can any one help me how to compile c code using qt and i am using arm-linux-gnueabihf-gcc.4.6 compiler?

Tags for this Thread

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.