Using Java to talk to an embedded system

Jun 15, 2007 6 Replies

A longtime customer has asked me to build a PC-hosted GUI to control an existing system I designed for him a long time ago. Actually the system was designed to control a vending machine, but he now wants to use the same hardware as a sort of poor man's PLC, to operate various other machinery in his facility.



I don't like wasting effort on Windows-specific code if I don't have to, so I was thinking of writing the GUI in Java.



Can anyone who has been down this path (i.e. talking to an embedded system over serial from a PC running a JVM) give any tips on the pros and cons of using something like javacomm vs. JNI? (I figure the JNI DLL would be


Hi Lewin,

This no doubt is not particularly helpful but I use a java telnet applet to talk to an embedded system which is online here:

formatting link

The embedded controller talks over RS-232 to a terminal server which is accessed by the telnet applet.

Embedded in the web page, the opportunity for GUI window dressing presents itself; I also use VT-100 graphics in the telnet session for GUI-like features (not particularly evident in my example yet).

Regards,

Michael

Oh, I can write the JNI stuff. That's no problem. Actually, I will do the development in MacOS anyway :) My question is, asking someone who's already tried to do something of this sort, whether it is a better prospect to look for native Java solutions or just go the simple route with JNI.

Well I have always gone the JNI route, and found it to work as expected. But as in my previous post, next time I will try javacomm + groovy, because it means I can write the sorts of simple apps I write using a scripting language + existing library, then drop the c compiler + makefile. I _suspect_ javacomm also works as expected. I will look with interest to see if anyone posts to your original question anything that puts me off ;-)

Regards,

Paul.

Well, I was pointed to this:

which is extremely interesting. I'll experiment with that this weekend.

Yay Intarwebs.

I had a lot of luck with using a JNI interface to a USB DLL. With something as straight forward as serial communications, it should be a snap.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required