# MODBUS debugging help in DIA with CPX4

**URL:** <https://forums.digi.com/t/modbus-debugging-help-in-dia-with-cpx4/12392>\
**Category:** Digi One IA/IAP\
**Tags:** modbus, x4, dia, xbee\
**Created:** [January 14, 2014, 12:30am UTC](https://forums.digi.com/t/modbus-debugging-help-in-dia-with-cpx4/12392 "2014-01-14T00:30:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stirlsilver](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stirlsilver](https://forums.digi.com/u/stirlsilver)\
**Post date:** [January 14, 2014, 12:30am UTC](https://forums.digi.com/t/modbus-debugging-help-in-dia-with-cpx4/12392/1 "2014-01-14T00:30:12Z")

</div>

Hello Everyone,  
I’m hoping someone might be able to assist me troubleshoot my implementation of a DIA project to read some values off a MODBUS enabled Monitoring System.

Below is the network structure:

ConnectPort X4 - XBee485 Adapter (Xbee)  
XBee485 Adapter - Monitoring System (2 Wire RS485)

Below are the screenshots of the Industrial Automation configuration on the X4 which I configured following the instructions here [http://www.digi.com/wiki/developer/index.php/Modbus\_Bridge\_on\_CPX4:](http://www.digi.com/wiki/developer/index.php/Modbus_Bridge_on_CPX4:)

[![](http://i8.photobucket.com/albums/a16/stirlsilver/IATableSettings_zpsf9af99e0.png)](http://s8.photobucket.com/user/stirlsilver/media/IATableSettings_zpsf9af99e0.png.html)

[![](http://i8.photobucket.com/albums/a16/stirlsilver/IAMessageDestinationSettings_zps6bf7a95d.png)](http://s8.photobucket.com/user/stirlsilver/media/IAMessageDestinationSettings_zps6bf7a95d.png.html)

[![](http://i8.photobucket.com/albums/a16/stirlsilver/IAMessageDestinationSettings2_zpsa4d85b16.png)](http://s8.photobucket.com/user/stirlsilver/media/IAMessageDestinationSettings2_zpsa4d85b16.png.html)

I tested the X4 to MODBUS communication using ModScan and was able communicate to the Monitoring System successfully:

[![](http://i8.photobucket.com/albums/a16/stirlsilver/modscan_zpsef24f083.png)](http://s8.photobucket.com/user/stirlsilver/media/modscan_zpsef24f083.png.html)

I followed the instructions to set up the DIA script according to this [http://www.digi.com/wiki/developer/index.php/Modbus\_Dia\_Client](http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Client)

My script regarding the MODBUS communication is below:  
 - name: mbus  
driver: devices.modbus.mbus\_udp\_device:MBusUDPDevice  
settings:  
poll\_rate\_sec: 15  
udp\_peer: “(‘127.0.0.1’,502)”  
round: 2  
poll\_list:  
- poll: “in01”  
pollinfo:  
uid: 1  
fnc: 3  
ofs: 0  
cnt: 5  
channels:  
- parse:  
nam: “SerialNumMSW”  
ofs: 0  
frm: “]h”  
unt: “num”  
typ: “float”  
- parse:  
nam: “SerialNumLSW”  
ofs: 1  
frm: “]h”  
unt: “num”  
typ: “float”  
- parse:  
nam: “FirmWareRS”  
ofs: 2  
frm: “]h”  
unt: “num”  
typ: “float”  
- parse:  
nam: “FirmWareOS”  
ofs: 3  
frm: “]h”  
unt: “num”  
typ: “float”  
- parse:  
nam: “DevID”  
ofs: 4  
frm: “]h”  
unt: “num”  
typ: “float”

THE PROBLEM

My problem with all of this after I compile my script and deploy it onto the X4 I get the following messages every 15 seconds via Telnet:  
DEBUG:mbus:Cyclic Process at 2014-01-14 05:43:00  
WARNING:MBusPDU:MbPdu.rsp\_parse() Exception Response = 0xC9 0B  
DEBUG:mbus:process slipped - adjusting for 2.66 lag  
DEBUG:mbus:Sleep for 12 seconds  
DEBUG:mbus:Cyclic Process at 2014-01-14 05:43:15  
WARNING:MBusPDU:MbPdu.rsp\_parse() Exception Response = 0xC9 0B  
DEBUG:mbus:process slipped - adjusting for 2.66 lag  
DEBUG:mbus:Sleep for 12 seconds

and the idig\_dia.html page gives:  
[![](http://i8.photobucket.com/albums/a16/stirlsilver/idigi_dia_zps31de80a2.png)](http://s8.photobucket.com/user/stirlsilver/media/idigi_dia_zps31de80a2.png.html)

Can anyone help??

---

<div class="post-metadata">

**Author:** ![stirlsilver](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stirlsilver](https://forums.digi.com/u/stirlsilver)\
**Post date:** [January 14, 2014, 6:00am UTC](https://forums.digi.com/t/modbus-debugging-help-in-dia-with-cpx4/12392/2 "2014-01-14T06:00:48Z")

</div>

One further thing I noticed after my post - If the DIA script is running on the X4, ModScan is not able to read the values from the monitoring system.

I disabled auto load of the python script, rebooted the X4 and then ModScan was able to connect and read values. I’m not sure if this is a symptom or if it helps in any way find a solution.

Thanks,  
Stirling

---

<div class="post-metadata">

**Author:** ![stirlsilver](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@stirlsilver](https://forums.digi.com/u/stirlsilver)\
**Post date:** [January 15, 2014, 10:52pm UTC](https://forums.digi.com/t/modbus-debugging-help-in-dia-with-cpx4/12392/3 "2014-01-15T22:52:43Z")

</div>

I contacted Digi directly and got the problem sorted. Below is what fixed my issue:

[i]Just read this wiki page:  
[http://www.digi.com/wiki/developer/index.php/Understanding\_XBee\_EndPoints#EndPoints\_in\_the\_Modbus.2FIA\_Engine](http://www.digi.com/wiki/developer/index.php/Understanding_XBee_EndPoints#EndPoints_in_the_Modbus.2FIA_Engine)

The customer needs to move the Xbee485 adapters end point away from 0xe8 to something else, like 0xE9. So change the IA route table to include the !E9 suffix.  
Only one process can bind on a specific zigbee/xbee end-point at a time. If you have the IA engine ‘owning’ end-point 0xE8, then the DIA (or any Python task) cannot bind to it.[/i]
