Reading serial port...

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Reading serial port...

Postby hantms » Wed Feb 16, 2005 8:35 am

This is not a super urgent question, more of a "Can Servoy do this" kind of question.

We get quite a lot of customers who run some kind of industrial measuring equipment, like a weighing bridge for example. Or a time-clock that recorsds when employees go in and out. Most of this equipment still communicates through a good old RS-232 serial port.

Is it possible to include some Java code that opens the serial port as a file for reading data? Is this code generally available or would we have to write this ourselves?

Cheers,
Han.
hantms
 
Posts: 6
Joined: Tue Feb 08, 2005 10:07 am

Postby bobcart » Tue Mar 01, 2005 7:06 am

The Java communications API makes it easy to talk to serial ports. That's the first hurdle. There are several beans out there that do different things with serial data so you might want to look at them depending on what type of data your are sending. A lot of the work is in the parsing of the data available. I've been working on NMEA data from GPS units.

Anyway, assuming you find a bean, or java code for your data type, you then need to include a listener and method to allow java to call a servoy method. Look at the source of the scheduler plug-in for some limited though useful clues.
bobcart
 
Posts: 214
Joined: Fri Nov 21, 2003 8:01 pm
Location: Melbourne (AUS)


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 9 guests

cron