Modbus and connectport

I am working within the hydropower energi production in Norway.
We are using Connectport-X4 together with XBEE devices for data collection from several typesof instruments/sensors (eg. a pressure sensor for sensing water level).
I am using the idigi/dia platform and the sensor data is published as device/channels.

The protocol for the sensors are typically

  • simple ascii formats
  • NMEA-183 and similar formats for weather sensors
  • modbus RTU/ASCII (slave)

The sensors are connected to XBEE RS485 adapters (or the serial port).

I have made device drivers for several types of sensors. For the modbus sensors i have made a subset of the modbus
protocol limited to requesting and parsing function codes for ‘read_input_registers’ and ‘read_holding_registers’.
For each instrument type, a mapping table for the modbus registers are defined.
It is always one instrument/device connected to each xbee adapter.
Therefore, i get rid of the modbus addressing problemacy.

My modbus implementation is somewhat ‘homemade’ but anyway it works for me and is running in a production environment for data
collection of hydrological data.

The device driver is based on example ‘Xbee serial device drivers’ included in the dia libraries (dia_1.3.19). However I could
not find examples involving modbus sensors.

So my question is if there are ready-made templates for handling modbus sensors through XBEE ?
As far as i can see, I do not need, nor gain advantage if the modbus/ia functionality?
Comments are appreciated.

Take a look at these pages:
http://www.digi.com/wiki/developer/index.php/Enable_Modbus_Query_of_Dia_Devices
http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Block_Register_Map
http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Code_Add-On
http://www.digi.com/wiki/developer/index.php/Modbus_Dia_Server

This is my efforts at Modbus :). It includes a ModbusTCP-in-UDP ‘server’ which leverages the X4’s normal IA engine. You just need to add the functions in the “Enable Modbus Query of Dia Devices” to your own drivers, plus enable the MBDIA presentation to listen for Modbus request on localhost UDP port 8502.

Yoru driver is passed a python dictionary descibing the Modbus request, and you are to return a list of words or error, which MBDIA rather blindly assumes is correct.

If you have questions, my email is my forum name with digi.com appended.