# Modbus TCP/IP on X4 via DIA

**URL:** <https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928>\
**Category:** Python\
**Created:** [May 31, 2011, 8:28pm UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928 "2011-05-31T20:28:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mumakin](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mumakin](https://forums.digi.com/u/mumakin)\
**Post date:** [May 31, 2011, 8:28pm UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928/1 "2011-05-31T20:28:11Z")

</div>

Hello,

I have a ConnectPort X4. I would like to set up a custom DIA device to speak modbus TCP/IP to a bunch of PLCs, collect all the data, and put it out into the iDigi cloud. I figure this is the sort of thing that has been done before, but can’t seem to put my finger on a good example. Can someone point me in the right direction?

Thanks,

Mike

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [June 1, 2011, 12:32pm UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928/2 "2011-06-01T12:32:29Z")

</div>

You have seen these, right:  
[http://www.digi.com/wiki/developer/index.php/Category:Modbus](http://www.digi.com/wiki/developer/index.php/Category:Modbus)  
[http://www.digi.com/wiki/developer/index.php/Modbus\_Dia\_Client](http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Client)

My client code will poll (pull) remote words in via Modbus, then parse these into Dia channels. It uses the IA engine, which adds a bit of config work, but allows it to support any collection of Modbus/TCP, UDP, RTU and ASCII via Ethernet, serial or even XBee RS232/485 adapters.

The IA engine support 802.15.4, Zigbee, and DigiMesh - but Dia currently only works with Zigbee.

---

<div class="post-metadata">

**Author:** ![mumakin](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@mumakin](https://forums.digi.com/u/mumakin)\
**Post date:** [June 1, 2011, 3:11pm UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928/3 "2011-06-01T15:11:41Z")

</div>

I had seen the Category:Modubs page, but there is a lot of information there and I was having a hard time finding what I needed.

The Modbus Dia client is exactly what I was hoping to find (and hadn’t). However I have a simple question. Is the source code for driver: devices.modbus.mbus\_udp\_device:MBusUDPDevice available? Surely this is where the UDP modbus requests are made and the channels are defined.

Thanks for your help

Mike

---

<div class="post-metadata">

**Author:** ![lynnl](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@lynnl](https://forums.digi.com/u/lynnl)\
**Post date:** [June 1, 2011, 3:44pm UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928/4 "2011-06-01T15:44:45Z")

</div>

It is on this page:  
[http://www.digi.com/wiki/developer/index.php/Modbus\_Dia\_Code\_Add-On](http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Code_Add-On)

This includes both the server and client, but the dia.zip will only contain the files required. There should be some readme’s in the ZIP, plus the ZIP include sub-directories so it is designed to copy on top of your Dia source files.

---

<div class="post-metadata">

**Author:** ![annos](https://avatars.discourse-cdn.com/v4/letter/a/58956e/32.png) [@annos](https://forums.digi.com/u/annos)\
**Post date:** [November 2, 2012, 4:43am UTC](https://forums.digi.com/t/modbus-tcp-ip-on-x4-via-dia/2928/5 "2012-11-02T04:43:58Z")

</div>

Lynn,

I’m probably making a newbie mistake, but I followed all the instructions on [http://www.digi.com/wiki/developer/index.php/Importing\_Modbus\_data\_from\_IO\_device](http://www.digi.com/wiki/developer/index.php/Importing_Modbus_data_from_IO_device) including all updates to my CP X4.

When I run the sample Python I get the following:

Core: Starting Channel Manager…  
Core: Starting Device Driver Manager…  
ERROR:AbstractServiceManager:Exception during dynamic class load: Traceback (most recent call last):

It doesn’t seem to find: devices.modbus.mbus\_udp\_device:MBusUDPDevice.

I checked dia.zip in the X4 and it has the right files (devices/modbus/mbus\_udp\_device).

Am I missing something?
