Modbus TCP Slave best library

I'm looking for a simple Modbus TCP slave/server, I'm new to Arduino and I had a look at :

https://code.google.com/p/mudbus/

I'm on a Ethernet shield with a usb serial, copied and pasted the example Mb, changed the IP address, loaded.

Iit answer PING, but when you try to connect to 502 port it says connection refused, what am I missing?

are there problems with IDE I'm using 1.5.4?

are there more updated libraries?

For those that will came...

I've deleted the Output pin part ... and now it works!

im trying to run the same code but im having a Ethernet scope error ( as shown in attached file). please can you help.

New Picture.bmp (1.14 MB)

Did you include the following statements at the top of your sketch?

#include <SPI.h>
#include <Ethernet.h>

Elle

Hi, everybody.
How used modbus tcp library for Arduino YUN?
What changes need to be made in the sketch? How to read/write down values in registers and coils?

Thanks in advance.

You are not providing enough information to let us know if you are wanting help with Modbus in the Arduino part or the Linux part of the YÜN?

If you are wanting to use Modbus in the Linux part then you might like to look at the libmodbus library, http://libmodbus.org/.

I use this library in a Cubieboard II to talk 24/7 to my Arduino to get real time data.


Paul

Good afternoon.

I have no wide experience of operation with Arduino controlers, in particular with Arduino YUN.
Now I look for an optimum method of the organization of communication of YUN with Modbus OPC server/SCADA/HMI for the Modbus TCP protocol (or RTU/ASCII).
From comments I understood that the Modbus TCP protocol can be realized to Arduino of part or to Linux of part of YUN.
Thus, as far as I understand, Arduino YUN have some methods of interaction.
With the ATMega32u4 controler via the virtual serial port (Micro-USB), in it a case it is necessary to use the class Serial (for Modbus RTU/ASCII).
With WiFi and Ethernet modules using Bridge library (for Modbus TCP).
If necessary, I can lay out the diagram with the used equipment.
I will be grateful to you for any detailed information with the description of the principles of both methods (perhaps with examples), and also for information which will allow me to understand as correctly to organize interaction between Modbus TCP OPC the server and Arduino YUN.

Thanks in advance.

If you have not a lot of experience with either Arduino or a GNU/Linux system then I think you will find it quite difficult to progress forward with trying to develop a Modbus server with SCADA and HMI, without first gaing some relevent experience.

I can tell you it can be a lot of work otherwise.

Yes, you can use Modbus on the Arduino or the GNU/Linux YÜN part, but, they will be very different libraries.
Also, for the Arduino, there is only a RTU master/slave or a TCP slave. There is no TCP master.

When using a GNU/Linux operating system, you can use the library I provided the link to which can do both RTU and TCP.

I'm not certain, but I understand OPC is only for microsoft windows based operating systems, not GNU/Linux.

If you want to see a working system, look at my signature and then find the section on QuadlogSCADA.
QuadlogSCADA is my development work since April this year, and is intended to be a full SCADA system developed in C.
It runs on a GNU/Linux system, such as Cubieboard or RPi or BeagleBoard or Intel CPU talking Modbus to Modbus devices such as Arduino. The HMI is a web application all written in javascript as a single page application.

Is this something like you are wanting to do?

What are you really wanting to achieve ?


Paul

Good afternoon.
All thanks for comments.

The wide experience of operation with microcontrollers isn't present. But basic sketches are quite clear to me. Operation with microcontrollers is a subject, quite interesting to me. There is an experience with industrial controlers generally in the standard IEC61131-3 languages (LD, FBD). As a rule, there already there was a support of different protocols. Also I have experience with GNU/Linux, basic experience of writing of scripts (bash, js, C ++ and others).
The project not commercial, for a personal experience and skills of operation with the equipment. It wasn't necessary to face implementation of protocols earlier. At the initial stage I want to receive council of skilled experts. I want to connect the Software of Iridium Mobile (AV/Custom System or Modbus) to Arduino YUN. Though, I would consider also options with the free Software. It is necessary to control not only from a local area network, but also it is remote, with possibility of back coupling. Possibility of guiding of archives. In principle it is easily realized by means of HTTP requests and scripts, but it very slowly. Generally the diagram looks as follows, with possible changes:
[Iridium Mobile] - (Internet) - [Gateway (or web server)] - (LAN or WiFi or USB) - [Arduino YUN].

Thanks.

I need help.
I dont know much about arduino, and i am trying to get a succesfull connection between arduino and Indusoft by Modbus protocol. Could some one share de code with me? I just could find examples with arduino uno, and i am using Arduino Yún.

Thanks all.

Gabrielima wrote:

I need help.
I dont know much about arduino, and i am trying to get a succesfull connection between arduino and Indusoft by Modbus protocol

If you don't know much about Arduino, then you will need to either learn or your other option is to think about paying someone to do the programming for you.

There are a number of Modbus libraries and quite a number of examples you can look at.
You don't explain whether you need the Arduino or the GNU/Linux section of the Yún doing the modbus communications to Indusoft?

Describe in clear detail what you are needing to do so that everybody can understand you better.
P.S. Please don't use PM to send the same message, and especially not on your first post
Welcome to the forum.

You can use python on linux side to make the modbus tcp connection. And use put and get to transfer data between Linux and Arduino.