Results 1 to 6 of 6

Thread: QT and USB Modbus comunication

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question QT and USB Modbus comunication

    Hello,
    I'm a new QT user and I want to implement a comunication from QT to Arduino.

    I want to use a USB-Modbus protocol. Currently I use the Qt 4.7 for Windows but in documentation I not have read any class to perform that comunication.
    In this forum I've read a old thread that resolve my problem (http://www.qtcentre.org/threads/1118...ort-and-QTimer) but in the new documentation (QT 4.7) there isn't the implementation of QextSerialPort class.
    Do you have some idea to resolve my problem?

    Thanks

    Roberto

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QT and USB Modbus comunication

    QExtSerialPort is not intended for USB.

    You need a driver that exposes an api that you can use to get the data from the USB port
    Any website about hobby electronics probably has a link to such a driver.

    Then you need to use that api and implement the modbus protocol.

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT and USB Modbus comunication

    Thank for your reply

    But I want put the data on USB port. I do use a driver that exposes an api also for put the data or that solution it's valid only for get the data from the USB port?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QT and USB Modbus comunication

    I guess most drivers can send and receive.
    http://sourceforge.net/apps/trac/libusb-win32/wiki

    You can also buy ready made solutions (read: a modbus driver)

  5. #5
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT and USB Modbus comunication

    Hello,

    Modbus is just a serial protocol using RS485 (something similar to the RS232 port on your desktop computer).

    You can use QExtSerialport (it's on sourceforge I think) for the serial communication.

    You can use an USB-to-RS485 convertor to communicate on the RS485 bus (you can buy it on Newark or Digikey or in your computer shop).
    This kind of converter acts like a serial port, so you don't have to know anything about USB.

    And then you have to implement the Modbus protocol (that is, send the correct data packets on the bus and handle the incoming data packets).
    I believe there is an open-source implementation of Modbus that can get you started for implementing the protocol.

    If you get this to work, give me a signal. I can use it too

    Best regards,
    Marc

  6. #6
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT and USB Modbus comunication

    Have a look at pvbrowser http://pvbrowser.de/pvbrowser/index.php - They have implemented Modbus RTU via USB and other protocolls.

Similar Threads

  1. Modbus implementation
    By ShamusVW in forum Qt Programming
    Replies: 14
    Last Post: 21st December 2011, 10:32
  2. Problem with comunication between widgets
    By laabor in forum Newbie
    Replies: 8
    Last Post: 8th May 2010, 13:07
  3. Modbus, QextSerialPort and QTimer
    By ^NyAw^ in forum General Programming
    Replies: 6
    Last Post: 27th October 2009, 16:14
  4. Read Sensor Temperature and Modbus Protocol
    By photovoltaico in forum General Programming
    Replies: 1
    Last Post: 7th August 2009, 08:32
  5. Modbus Protocol
    By ^NyAw^ in forum General Programming
    Replies: 0
    Last Post: 21st January 2008, 10:37

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.