Subject: Output to digital to analog converter

From: glenn sharrock <[email-masked]>
Date: Mon, 09 Mar 1998 11:19:55 +1000

Just a quick question from a PhD student interested in robotics and systems
control.

I am writting code (using a PC) to process digital input from a A to D
converter and output a different signal.

Does anyone know how to send and read bytes from serial or parrallel port
using Java (I imagine the multi-platform nature of this language could
create problems here)?

Cheers Glenn

---

From: "Thomas Maslen" <[email-masked]>
Date: Sun, 08 Mar 1998 23:39:39 -0800

> using Java (I imagine the multi-platform nature of this language could

Good news:  there is a shiny new Java API that should handle things like 
this.  See the early-access Java Communications API Documentation on

		http://developer.javasoft.com/

(to get to the information you'll probably have to set yourself up with a
username and password if you haven't used the JDC before).

Bad news:  I don't know when implementations of the API will be available 
for your favourite platform.

In the interim, one approach is to write a separate small process, in C,
that deals with the low-level details of talking to the port and then
communicates with the Java process by, e.g., localhost TCP.  This won't
exactly give you wonderful latency (I hope this isn't meant to be real-
time control), but it does keep the nasty details out of the Java process.

Alternatively, there seems to be no shortage of Wintel-specific solutions
for getting at serial ports (and maybe parallel ports too), but I haven't
been paying enough attention to remember any details (and java-for-cse
isn't one of the more likely places to find them -- maybe try DejaNews
on comp.lang.java.programmer?).

Thomas Maslen
[email-masked]

---

From: "Paul A. Houle" <[email-masked]>
Date: Mon, 09 Mar 1998 08:37:53 -0500

If you can't wait for the Communications API,  it isn't hard to
write a native method to do this sort of thing.  Just make sure you use
Java 1.1 and JNI so you won't get locked into a non-standard native
method interface.  I've had good luck using native methods to import
mathematical functions from IBM's ESSL package as well as other things.