using javax.comm with usb-serial port adapter

Y

yakka

Hi there,

I have written an application for reading data from a lab instrement
through RS-232 interface.
The instrument has only a serial port output for printer, so it only
sends data.
The problem is mainboard of computer has only one serial port but I
need to communicate another device through RS-232 interface. Is it
possible to use a usb adapter to connect device with javax.comm api.
Thanks in advance...






Yalçin Öksüz

Hacettepe University

Türkiye
 
P

PaullyB

yakka said:
Hi there,

I have written an application for reading data from a lab instrement
through RS-232 interface.
The instrument has only a serial port output for printer, so it only
sends data.
The problem is mainboard of computer has only one serial port but I
need to communicate another device through RS-232 interface. Is it
possible to use a usb adapter to connect device with javax.comm api.
Thanks in advance...






Yalçin Öksüz

Hacettepe University

Türkiye


I have used the javax.comm api to communicate with a GPS receiver using
a USB-to-serial adapter on a PC running windows and have not had any
problems. The only thing I noticed is that the port number is variable
so you need to programmatically determine which com port the
usb-to-serial device is registered on. For example, if you plug in the
adapter it might register as com5. If you unplug it and plug it back
into the same USB port, it would register as com6 (at least this is the
sort of behavior that I saw). I dealt with this programmatically by
enumerating over the available serial ports and checking if the device
on the current port was the device of interest.

I also used rxtx to do communications when running linux and did not
have any problems using an adapter.

Good luck,
p
 
Y

yakka

PaullyB yazdi:
I have used the javax.comm api to communicate with a GPS receiver using
a USB-to-serial adapter on a PC running windows and have not had any
problems. The only thing I noticed is that the port number is variable
so you need to programmatically determine which com port the
usb-to-serial device is registered on. For example, if you plug in the
adapter it might register as com5. If you unplug it and plug it back
into the same USB port, it would register as com6 (at least this is the
sort of behavior that I saw). I dealt with this programmatically by
enumerating over the available serial ports and checking if the device
on the current port was the device of interest.

I also used rxtx to do communications when running linux and did not
have any problems using an adapter.

Good luck,
p


Thank you very much for your help, I am a beginner in java and trying
to learn it from books, so it is very nice to get help from experienced
programmers.



Yalçin Öksüz
 
Joined
Aug 17, 2006
Messages
1
Reaction score
0
GPS Reveiver and Javax

Hi Paully B.
Thanks for the info!

jc
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top