Xbee - ConnectPort - SCADA - Mango

Hi Guys,

I have been experimenting with Connecting Arduino to SCADA systems vis Xbee for the past year and would like to pass on some info.

I have just finished installing and setting up MANGO, and have the following up and working:

Arduino with 6 Analog inputs, 6 Digital inputs, 4 Digital outputs and 2 Analog outputs.
Connected to a DFRobot IO Expansion shield V5 with a Digi Xbee Series 2 Radio.

This communicates AS a slave with Modbus RTU, however, this is where it gets better…
I then use my Digi Connectport X4 Gateway’s Industrial Automation(IA) capabilities to convert this to Modbus TCP.
The X4 has a built in Xbee S2 and Ethernet.
Then, the Mango data source simply points to the IP address of the X4 Gateway on port 502, Slave ID 1.
This means that I can can connect to this data from anywhere and not limited to a serial connection.

And it gets better even still…
I can set up lots of these Arduino nodes. I just set a new slave ID in the Arduino code, say 2, set a new table entry in the X4
with a new port, say 503, then direct Mango to the X4 address, 503 and Slave 2.

Analog sensors I have used include, LM35 temperature, light, voltage divider, Pots, sound, current.
I have a fan hooked up to one of the analog OUTPUTS via a MOSFET that I can set the speed from within Mango.
All this over a Digi Xbee Series 2 Mesh up to 3 kilometres (theory) away!

The code Arduino code size is only 6.9K, and I can have as many registers as I want, limited by the speed of the Xbee mesh.
From my understanding, you could also use a Connectport X2, which has just the Xbee radio, and Ethernet, but has firmware
available for flashing that includes Modbus. (Check before purchase, as I do not have one)

So lets look at the price:
Arduino/compatible $25 (DFRobot)
Xbee/expansion shield $20 (DFRobot)
Xbee Series 2 $45 (DFRobot)
Connectport X2 $139 (Sparkfun) (X4 $400+)
Mango $Free

So once you have an X4/2 the node cost is only $90, plus sensors of course.

OK so what Arduino libraries you ask???


I AM having one problem that hopefully someone can help me with.
I cannot get the Digital outputs to stay on in Mango. After a couple of reads they go off. I have tried just about every setting,
but have come to the conclusion that it is the Arduino code. I also use ADAMView(advantech), and it also turns off the outputs,
but only when you stop the service, not WHILE IT IS RUNNING like Mango.

Attached Arduino INO. I have stripped out a lot of the comments and simplified the code for ease of use. Get the library from the above link.
Advantech ADAMView DEMO(2Hrs) Full(~$190) http://support.advantech.com.tw/support/DownloadSRDetail.aspx?SR_ID=1-H1VQ1&Doc_Source=Download
(With ADAMView, you use the included TCP OPC server) ASK me for info if you want to run ADAMView on Windows 7.
Mango http://mango.serotoninsoftware.com/

You can use this system with ANY SCADA package that supports Modbus TCP/IP.
I can also control and monitor the nodes with my Android!!! (But that is another story)


MODBUSslave_Advantech_All_V2.ino (3.44 KB)