[Qt-interest] Fw: Modbus

Shaun van Wyngaard (Home) shaungvw at gmail.com
Sat Oct 31 04:18:36 CET 2009


My mistake, I only seem to have replied to the sender of this reply, not everyone else.


From: Shaun van Wyngaard (Home) 
Sent: Wednesday, October 28, 2009 7:59 PM
To: Mirko Viviani 
Subject: Re: [Qt-interest] Modbus


Specifically I want TCP/IP.
"Francisco Gonzalez" very kindly supplied the following links, although they are for serial comms, and I will go through it anyway.

qmodbus.sourceforge.net
based on the c library
http://sourceforge.net/projects/libmodbus/

I am looking for an example of the "hard-coding" of the array, e.g. knowing it is function code 3, the address to look at, etc. without calling separate functions to fill the array, I just want to make an example that works, then I can neaten it up, etc. So example, I want to code  (not exactly correct code, just demonstrating)

data[0] = "something";
data[1] = "something else" ... etc

tcpSocket->Connect("193.1.1.14",502...)
tcpSocket->write(data...
.
.
tcpSocket->read(data...

I want to use QTCPSocket to do the connecting and writing (and reading), but not sure how to fill my array.
The registers I want are from the holding registers (40001 -->). I have tried manually filling this array, writing it, and then reading back again, but I guess garbage in [to the socket] equals garbage out [from the socket]

In the links above (and what I have already to work with), the source all use uint8_t, surely it could use something like quint8? This would then make it more "Qt-like"

Thanks,
Shaun



From: Mirko Viviani 
Sent: Wednesday, October 28, 2009 3:08 PM
To: Shaun van Wyngaard (Home) 
Cc: qt-interest at trolltech.com 
Subject: Re: [Qt-interest] Modbus


Modbus through RS232 or Modbus through TCP-IP ?
Both cases, is just a matter of sending (a byte array) and receiving (a byte array).
RS232 involves also the calculus of CRC.


2009/10/26 Shaun van Wyngaard (Home) <shaungvw at gmail.com>

  Has anyone done a Modbus implementation using Qt?

  _______________________________________________
  Qt-interest mailing list
  Qt-interest at trolltech.com
  http://lists.trolltech.com/mailman/listinfo/qt-interest





-- 
-- Mirko Viviani --
GPG-PGP Public Key: 0xE4E8FAB1
Fingerprint: 14D3 A373 E926 7737 DF32 502B A4C4 1CE2 E4E8 FAB1
***********************************************
"“Machines take me by surprise with great frequency.” A. Turing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091031/747ab13b/attachment.html 


More information about the Qt-interest-old mailing list