Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
You can help to find a bookcase me in C++ in order to write a program that communicates via Modbus on TCP like master?
Possibly to have sources in C++ to compile with Qt ver. 4.6.0 on Windows.
Thanks to all of heart.
Posted

At Modbus Technical Resources and Wikipedia site you may find a bunch of resources.
:)
 
Share this answer
 
Member 1663164 wrote:
thanks for the answer, but I have already watched. I would need having a simple example of code in C++ to study and to understand.


If you had actually read some more of the information on the link Carlo provided you would have discovered exactly what you want. Try again.
 
Share this answer
 
This really is becoming hard work!

Did you scroll down and read this far?

Free Modbus Simulator
[^]
Modbus RTU and TCP/IP simulator intended as a master-tester and for users commissioning HMI/SCADA applications. Well featured, emulates multiple slaves at once; C++ sources available.
 
Share this answer
 
Seriously: can you FULLY understand this?

#include <iostream>

class A
{
public:
   A() { std::cout << "Hallo ..." << std::endl; }
   ~A() {  std::cout << "... Bye!" << std::endl;  }
};

A a;

int main()
{ 
   return 0;  
}


If your answer is "no" or "partially", then the problem is not what you asked, but C++ itself.
If that's the case, you'd better to start from the very beginning ...
 
Share this answer
 
Thank Richard MacCutchan, use this simulator (Slave) of modbus in order trying the code that I am writing with the Qt (C++).
I would have the pleasure of being able to on hand put to you all the code that I am writing... how I must make?
 
Share this answer
 
Member 1663164 wrote:
Thank Richard MacCutchan, use this simulator (Slave) of modbus in order trying the code that I am writing with the Qt (C++).
I would have the pleasure of being able to on hand put to you all the code that I am writing... how I must make?


I don't understand the question, if you are asking for help and advice with the MODBUS code then I suggest you use their web site, as you are much more likely to find expertise there rather than here.
 
Share this answer
 
"At Modbus Technical Resources and Wikipedia site you may find a bunch of resources.
Smile
Permalink | Broken Post? Report
Posted 18 Jan '10 11:35 AM
CPallini 34,981"

Thanks of the answer. I have watched the 2 URL that you have given to me, but have only found code in C# (is what I have already used with happening for AEM).

I have of the difficulties to transform the type of data byte [] of C# in the correspondent in C++.

moreover I do not know as translate in C++ (I use the Qt the 4.6.1 of Nokia) following functions:

BitConverter.GetBytes((short) id) where id is integer
IPAddress.HostToNetworkOrder()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900