For my latest project, I had an interesting challenge, which I thought some of you readers might find equally interesting. It involved a (relatively) simple control system, with an Allen Bradley MicroLogix PLC, and 30 or so inputs and outputs. The challenge was that the customer wanted to be able to access (and potentially control) live machine data from anywhere on their network, while buying as little hardware or software as possible. After a bit of research I came up with the following solution:
 
The only entryway to the data that was available with no additional hardware was the Modbus RTU network already in place, that fed data from the PLC (master) to some intelligent analog gauges (slaves) in the field. If I tapped into that, and sent the signal through a cheap Modbus RTU to TCP/IP converter (the only hardware addition necessary), I knew I could just plug into the customer’s existing Ethernet network, and have all the data I needed available from any Modbus TCP/IP server also plugged into the network.
 
That was the easy part. The hard part was finding a way to display that data in a meaningful way on a PC. After a bit of research I found two options. Two libraries, one for Visual Studio .NET offered by Win-TECH, and one for Java (called jamod), that could set up both client and server Modbus TCP/IP connections from a PC. The core differences were that the .NET library was supplied by a private company and cost thousands of dollars, whereas jamod was open source, had an active online community, and was free to distribute under a modified BSD license. Even after weighing the risks of leaning on an open source solution (lack of support), the jamod solution seemed a little more enticing.
 
After surprisingly little tinkering around, I had it up and running. The library simply extends the regular Java TCP/IP Connections class, and offers many of the same connectivity functions, along with all of the standard Modbus communication functions. It really opens up the possibilities for custom remote monitoring software. My customer can now log into their machine, check the status of (or modify) all of its parameters, and log the data to a local CSV file, all from any computer that can run the Java Runtime Environment. Even neater, the JRE is available on many mobile platforms, giving anyone with the right smart phone the ability to peek into the machine data.
 
Jamod truly opens some exciting doors. This open source library, combined with Modbus (the most widely used protocol in the manufacturing world), makes it easier than ever to create customized remote monitoring and control applications with extremely low hardware and software costs.
Share this page:

Comments

-->
# Robert Honders
Tuesday, November 24, 2009 7:50 PM
Sounds like exactly the solution I have been looking for to read the Circuit Monitors (power meters) in my Micro Hydro powerhouse. How about some data logging? Do you think that can be done as well?
Rob

Robert J. Honders CE
Honderosa Valley Consulting & Renewables Research
Studio Building I
129 Kennel Rd.
Cuddebackville NY 12729

Honders@HVC.RR.COM
Robert@Honders.com
Phone: 845 754 7106
http://energyindependence-rob.blogspot.com/
-->
# Jon Carson
Sunday, November 29, 2009 9:02 PM
I'm glad you found this post helpful. You can absolutely accomplish data monitoring using this method. I have implemented it on most of my Java/Modbus control applications. It's very easy to get as sophisticated with it as you like-- anywhere from simple CSV file logging on a local hard drive, to full-on database entry and automated reporting services. One thing to note is you will run into difficulties if you try to log to a CSV file using a Java applet instead of a Java application, because applets do not have file read/write capabilities. It sounds from your description however that an applet would not be the right solution anyway--a pretty quick program could probably do everything you desire.

If you would like to talk more about details feel free to either reply here or send me an email at jon.carson@dmcinfo.com

Regards,

Jon Carson
-->
# Travis
Tuesday, January 26, 2010 11:11 AM
Do you think this will work for mac osx?
-->
# Jon Carson
Tuesday, January 26, 2010 11:25 AM
Java is platform independent. I have never developed Java on the Mac, but I know it can be done. Any Java library will work wherever the latest version of the Java Development Kit (JDK) and Java Runtime Environment (JRE) are installed, and these are available for Windows, Mac, and many others.

Regards,
Jon Carson
-->
# JOHN
Tuesday, June 15, 2010 11:57 PM
hi,

i am new to this field. but i have to work on modbus tcp/ip. i found one modsim32 through i did tct/ip connection using port no 502 in two differnt pc. now i copy the Tcp Master program from jamod and run that. i tried a lot but i found one error code 2 which means address reference is not correct. i spent alredy 3 day but can't find the exact solution for this. if u have any solution please help me

if u say i will send allthe screenshort and my program and error msg to u so that u have clear idea.

Thanks,
John
INDIA
-->
# JOHN
Tuesday, June 15, 2010 11:58 PM
hi,

i am new to this field. but i have to work on modbus tcp/ip. i found one modsim32 through i did tct/ip connection using port no 502 in two differnt pc. now i copy the Tcp Master program from jamod and run that. i tried a lot but i found one error code 2 which means address reference is not correct. i spent alredy 3 day but can't find the exact solution for this. if u have any solution please help me

if u say i will send allthe screenshort and my program and error msg to u so that u have clear idea.

Thanks,
John
INDIA
-->
# Jon Carson
Wednesday, June 16, 2010 9:33 AM
Hi John,

As far as I am aware, the error code you're describing means that your Modbus slave doesn't have that register address. Make sure the Modbus slave (modsim32?) has that register available, and also be aware that sometimes different Modbus components address things differently, i.e. some start at 0 and some start at 1, so register 0x40001 on one device might be 0x40002 on another. If you can't figure it out from there I recommend the jamod forum, which is at http://jamod.sourceforge.net/ . Good luck!

Jon
-->
# Roberto
Wednesday, June 22, 2011 1:53 PM
Hi Jon,
I have same requirements as yours, but with de-centralized plants, so I need to get data and status in Modbus TCP from different sites.

All plants can be reached via Pubblic IP but dynamic, so I need to address a domain name, mapped on dynamic dns service, and resolve in IP address, does the Modbus TCP with Jamod library implement that?

Thanks
Roberto
-->
# Billy Smith
Wednesday, August 10, 2011 10:05 AM
Thanks, for the article. I am trying to use jamod to write an application to help automate testing of some chillers using the MCS-Magnum controller. Do you have any experience with these? With TCP connections I am seeing ACK's from the controller but I am unable to establish a connection.
-->
# Erick
Wednesday, March 28, 2012 9:14 PM
I need the source code, its a proyect to my job.
-->
# Krishna Aryal
Monday, May 14, 2012 1:00 AM
please help me how to access sansaphone remote monitoring system data from java.

Post Comment

Name (required)

Email (required)

Website

Enter the code shown above in the box below