Converting Modbus to EtherNet/IP

Converting-Modbus-to-Ethernet
I just spent a week in Milan on business. Well, not a lot of business. Actually, just one meeting to help an Italian company design their EtherNet/IP interface.

Milan is one of the really great cities in Europe. I am intrigued by so many things there. Il Duomo, their cathedral, is just a wonder. The place is an Engineering marvel built on top of a church that was there in the 3rd Century. How they built something so large, so complex with such intricacies in the 12 century with no power tools or cranes is just amazing. My other top picks for Milan include the Leonardo DiVinci museum and Leonardo’s painting of the Last Supper. Lots to marvel at in Milan.

So, I interrupted my visits to these sites to sit with a major international scale company for a day. It was similar to a lot of these kinds of visits I’ve done over the years. They have a Modbus implementation (both Modbus RTU and Modbus TCP) and they need to get to EtherNet/IP.

Pretty much the same as a lot of the projects we’ve done. The only complication here is that their software supports seven different scale models. There’s a different set of data for each of the models. The simple ones just support the standard stuff like Tare and Gross weight while the sophisticated ones control motors on a conveyor.

One of the least understood aspects of the EtherNet/IP Object Model is that Application Objects aren’t required. That’s Right! You don’t have to have even a single Application Object. So, “how does a Scanner access the scale data”, you might ask. I put together a design for them that just has Object 4, the Assembly Object.

The Assembly Object is all you need to exchange data with a scanner. You need an Input instance to receive Input messages from the scanner and an Output Instance to send data to the scanner. In this case I figured we would just point their Input and Output Instances right to their Modbus buffers. That way, the same data is available via Modbus TCP or EtherNet/IP.

Another problem I had was Explicit Messages. The scale guys wanted to make their data available to EtherNet/IP Tools that use Explicit Messaging. Well now, I had a problem. I really wanted to avoid any Application Objects but I had no choice but to add one.

But, cleverly (if I say so myself – no one else will), I decided to create and Object 64 hex (first Application Object Number) with a single instance, instance 1. I then made the attribute numbers for that Object the same as the Modbus Register Numbers. So if on Modbus TCP you access Register 95, on EtherNet/IP you would access Object 64, Instance 1, Attribute 95. In that way, I didn’t really have to create the Object since it would just index right into the Modbus buffer that is being used for both Modbus TCP requests and EtherNet/IP I/O messaging.

It was a very clean solution. Customer was happy. I was happy. They fed me a great dish of pasta for lunch. And I was quickly on my way back to the streets of Milan and all the great sights with some of the most drop dead gorgeous women in Europe and a fine Italian dinner. Can’t beat a day like that!