A Modbus Developers' Community

A Control.com syndicated community

Link to Control.com main site
Control.com main forum

Link to the Modbus.org site
Modbus.org main site
Users' Forum

To view additional discussions, click here.


Return to Modbus Developers' Community Home Page

Modbus over Ethernet
Jun 26, 2008 12:14 am, by Gabe
Subject : Engineering
from the Student final year project dept.
Text :
Hi there,

I am currently in my final year of bachelor of engineering (electrical) and am doing my final year project. Part of the project is to set up some new Automatic Transfer Switches (ATS), which are Modbus compatible to our concurrent SCADA network.

I'm aware I could use RS485 and then program the relay on the ATS from there to work with the SCADA server. HOWEVER, I understand that Modbus is a protocol, much like TCP/IP and stuff like that... but what I don't understand is: is it possible to use Modbus on ethernet? I don't get it, it makes no sense.

Can someone please help a student? :)
Reply


  • Re: Modbus over Ethernet
    Jun 28, 2008 2:10 am, by CCOMM
    Probably the easiest way is to use a serial-to-Modbus TCP server.

    Several companies make them, but the only one I've used is the B&B Electronics model MES1B (for RS-422/485; the RS-232 version is model MES1A).
    http://www.bb-elec.com/product_family.asp?Familyid=275

    I haven't used it under heavy loads yet, but it works for what I'm using it for, and was fairly easy to set up. My only misgivings so far is with the configuration software installation CD - it doesn't come with the (necessary) older version of Microsoft .NET Framework included, and you have
    to download it separately. Don't know if the software *operates* under the newest version, but the installer looks to see if you have the older version installed, and, if not, won't allow installation to continue. In my opinion this is a bit cheesy, but I've seen worse.
    Reply

  • Re: Modbus over Ethernet
    Jun 28, 2008 4:59 pm, by pvbrowser
    Here you can see the sourcecode of our
    ModbusTCP implementation:

    http://pvbrowser.de/pvbrowser/sf/manual/rllib/html/classrlModbus.html

    It is part of our open source hmi/scada framework.

    http://pvbrowser.org
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 1:23 am, by Jerry Miille
    Hello, Gabe!

    Welcome to the world of communication!

    First, for Modbus questions, start at
    http://www.modbus.org You can find the answer to almost all your questions there.

    Second, there are at least three ways that I know of to use "Modbus over Ethernet".

    First, you can simply encapsulate a "standard Modbus message" in either a TCP/IP packet or a UDP/IP packet and send it. I call this "serial port tunneling" and you can use this method to send almost any serial protocol same as any other serial data stream. Modbus over TCP/IP is pretty common; Modbus over UDP/IP is less common (in my experience).

    The biggest gotch'a in doing this is if you are attempting to use standard Modbus RTU protocol. Modbus RTU uses a "silence time" to frame the messages. If you cannot control it, your message may be split between two packets and will be received with a time lapse between frames. All the characters will be there but because of the time lapse, the message will not be received correctly. So, you either need to make sure that the entire message is delivered in one packet or switch to Modbus ASCII that uses specific Start of Message and End of Message characters.

    The third method that I know of is Modbus/TCP protocol. The big differences here are in how the connection(s) (there may be several simultaneous
    connections in operation) are made and then some differences in the message itself: The "Modbus Address" is replaced by a 6-byte (as I recall) header that has additional connection information and the CRC is removed (because it is automatically handled as part of the IP protocol stack). This is well documented on the Modbus.org site and in many other places as well. The header also includes a message character count so the problem of getting messages in two packets is removed.

    Good luck to you in the future.

    Jerry Miille
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 1:17 am, by James Ingraham
    "is it possible to use Modbus on ethernet?"

    Yes... and no. Modbus is indeed a protocol. It was originally a serial protocol. It's pretty easy stuff though; send a string out the com port, get a string back. The strings are easy enough to put together and parse apart. The Modbus protocol has now been "ported" to Ethernet, and it's called Modbus/TCP. There are some minor differences, like the fact that you've now got binary data instead of ASCII text, and you don't need the CRC check that the serial version had. (Actually, just to complicate things further there's Modbus/RTU, which is the binary-over-serial version of Modbus. Still has the CRC, though).

    So in theory you can just plug a Modbus device in and send commands to it over Ethernet using packets formated as Modbus/TCP. But where exactly would you plug it in? There's no way to physically connect them. Thus, to get a Modbus device onto Ethernet you MUST have an Ethernet-to-serial gateway. Lots of people make these. Some are even industrial protocol aware, so that you can use Modbus/TCP and it will automatically deal with things like the CRC on the serial side. The Digi One IAP comes to mind immediately, but there are plenty of others.

    Note that unlike the Modbus/TCP protocol the gateway is going to cost money. Probably more than a $100, but less than $500. Seems crazy, I know, but there it is.

    -James Ingraham
    Sage Automation, Inc.
    Reply

  • Re: Modbus over Ethernet
    Jun 28, 2008 2:26 am, by Michael Griffin
    In reply to James Ingraham: To clarify your explanation, it should be pointed out that there are plenty of devices which use Modbus/TCP directly. You only need a gateway if you have some Modbus/RTU or Modbus/ASCII devices that you want to connect with Ethernet. Generally, gateways are for older products which don't have Ethernet built it. For newer applications, you would simply use devices that have Ethernet built in.
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 12:56 am, by Dweebyone
    Modbus is a protocol. You can use Modbus protocol over Ethernet, it is then called Modbus TCP/IP. Commonly used by Schneider Electric, as Schneider bought the company Modicon, and Modicon originally created Modbus.

    The packet of data embedded within TCP/IP is therefore in a Modbus format.

    Various PLC/HMI/SCADA manufacturers use Ethernet, Siemens commonly uses ProfiNET (Profibus over Ethernet), Rockwell/Allen Bradley use Ethernet IP.

    Assuming you want to use Modbus TCP/IP you need to make sure all devices talk Modbus over TCP/IP, including Ethernet switches.
    Reply

  • Re: Modbus over Ethernet
    Jun 28, 2008 2:28 am, by Michael Griffin
    In reply to Dweebyone: To clarify one of your points, Modbus/RTU serial tunnelled over Ethernet is slightly different from Modbus/TCP. Modbus/RTU serial uses timing gaps between packets to signal the end of a message. This can cause a problem if the Ethernet packets they are packed into get split up. This is a common problem when tunnelling many serial protocols over Ethernet.

    With Modbus/TCP, you can use ordinary network hardware, as it is a true Ethernet protocol and isn't using time delays to signal end of message.
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 12:18 am, by Michael Griffin
    The protocol is called Modbus/TCP and it is used quite extensively in industry. I don't know how common it is for the sort of equipment you are
    working with however.
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 12:30 am, by dchartier
    Hello Gabe;

    First of all, there exists a version of Modbus called Modbus/TCP; it is very common and the specs can be found on many websites (here for example;
    http://www.rtaautomation.com/modbustcp/files/Open_ModbusTCP_Standard.pdf).
    You could also have a look at the Modbus community links on this forum at the left of this page.

    Basically, Modbus/TCP encapsulates the Modbus/RTU data string inside the data section of the TCP frame. It then sets up a client/server exchange between nodes, using TCP/IP addressing to establish connections. Look it up in the specification document I suggested earlier.

    I have also seen in certain point-to-point applications using simple serial to Ethernet converters (from B&B Electronics, or Black Box) between Modbus/RTU nodes (basically when you need to extend the distance allowed by the serial protocol specs); however for multinode tasks this can become heavy to manage.

    Hope this helps,
    Daniel Chartier
    Reply

  • Re: Modbus over Ethernet
    Jun 27, 2008 12:13 am, by Mark
    Hello,

    Yes. Check out:
    http://www.modbus.org/

    Good luck,

    Mark
    http://www.peakhmi.com
    Reply


  • The man who sets out to carry a cat by its tail learns something that will always be useful and which never will grow dim or doubtful. - Mark Twain
    Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is ©1999-2006 Control Technology Corporation. Powered by Python, Zope, and Squishdot, inspiration by Slashdot. (Vers.ZSQ1.0)