Hello I am new to this sight and also to Arduino. I bought an Arduino with the Labview package because I am familiar with Labview. I am wanting to use an HMI software called Ignition but it need Modbus TCP to communicate with it. To be honest I don’t really know what that is. I would like to get the Arduino uno set up so I can use a couple inputs and display them with my HMI software. I have searched for Modbus program but since I don’t understand it I have not had any luck.
Thanks for any help.
Firstly, welcome to the forum.
For Modbus TCP, you will need a library.
There are two libraries you can choose from, with one being an extension of the first.
The original library is called Mudbus, and was available on the Gitorious site, but that is being put to archive.
The second is available from this link My Arduino Projects - Website dedicated to my arduino projects - A ModBus TCP library for the Arduino system.
I use the first library, mudbus. They are very easy to use, once you understand a few things about Modbus in general. I would suggest you learn the basics of Modbus first.
What Arduino did you buy ?
Could you tell more about what you are wanting to do, in case there are other things to consider ?
I'll take a guess that, from your user name, you are possibly playing around with DHT22 sensors, is that correct ?
Paul
Thank you Paul for the link and the quick response. I bought the Arduino UNO just to get into microprocessors. I am new to all of this but I am learning fast. Like I said I have some Labview experience but not enough to know what I am doing. As for what I am doing is working with my employer on new software from Ignition. I have never heard of it but we will be getting it in the next couple weeks, so I just wanted to get a head start. What I will be doing with the software is setting up a visual station so my bosses can see what is going on, and I will also be setting alarms for any issues that might come up. I will be using mostly analog signals to the Arduino.
And I don’t know what a DHT22 sensor is LOL I used my initials for my name.
I will download the library and try and write back tomorrow I’m sure it will give me more questions.
Hello again I got a chance to download the program but I get a compiling error. #include "MgsModbus.h" no such file directory. I see the H file on the link you provided but I don’t know what to do with it. Any help?
And thanks again.
Ok I figured out my H file problem I’m getting ready to start my first Modbus project. I have little time so I’m not sure when I’ll get to it.
Thank again for all the help
Good to hear.
Things to consider are with how you deal with the analogs you wish to read.
I would suggest you simply read the analog and do not scale it at all in the Arduino, but rather, just send the raw ADC value as read by analogRead() function via Modbus.
Then at the other end, on your computer in Labview, scale the raw ADC data to engineering data.
The other thing is to consider some form of filtering on the analogs, depending on what sort of sample rate you need. This filtering may be done either with some additional circuitry or you can do software averaging.
For pure digitals, pack those into bytes or better still, 16 bit as uint16_t as that is what the Modbus registers will be. Doing this will allow you to have 16 digitals in a single Modbus register.
Take note of the limitations of how many registers you may have in any one packet, though, I think if you are only sending a handful of registers, you will be fine.
Keep us updated, if you need any help, just shout
Paul
Ok on my project I have decided to back track a lot. Im not looking at a Modbus right now I will look into that in the future.
Now I am having trouble just getting my shield to connect. I am using a Seeed W5200 Ethernet shield from Radio Shack. I downloaded library EthernetV2_0.h from http://www.seeedstudio.com/wiki/File:W5200_Ethernet_Shield_Library.zip
My problem is nothing with the #include < EthernetV2_0.h > will compile.
I think my first step is getting my Arduino online then go further.
Can anyone help? Seams to be a lot of literature out there on this but I’m just going in circles.
1 last thing my shield didn’t come with a mac address I’ve looked and looked all over it but it’s not there.
Shoud I make a new post for this?
Well, you need to read up on the Yún to fine out a few more things.
I don't know the Yún, having never used it, but, from reading the Arduino product page it suggests to me that the SPI is used to communicate to the GNU/Linux section.
Here is the link for you to read on the Yún board, read section about SPI.
Quoted:
SPI: on the ICSP header. These pins support SPI communication using the SPI library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Uno, They are only available on the ICSP connector. This means that if you have a shield that uses SPI, but does NOT have a 6-pin ICSP connector that connects to the Yún's 6-pin ICSP header, the shield will not work
I think you need to work out what are your needs more clearly and describe them in a 'Functional Description' document which will help you as you work through your project. List out the criteria, the things you know you need to do, the things you know you must not do for this project to be successful.
I hope this will help you stop going around in circles.
Paul
He has an Arduino Uno with ethernet shield, not a Yun.
I think op you need to read more specification about your shield.
Oh yes, thanks mart256, I was getting myself mixed up with another thread, sorry
Paul
Thank you again guys I have done some more research and found this forum.
http://forum.arduino.cc/index.php?topic=316764.0
I had an older copy of the zip file so once I downloaded the up to date file I was able to get the serial port to print an IP address.
I’ll continue to keep my progress updated. So thanks again