Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes I/O and Streams and the fly likes Reading/writing from/to serial port Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Reading/writing from/to serial port" Watch "Reading/writing from/to serial port" New topic
Author

Reading/writing from/to serial port

anitha meena
Ranch Hand

Joined: Oct 22, 2007
Posts: 40
Hi All,
I am trying to write java application which read/write data from/to serial port , I have found this application in the net
(http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php) which is a very good example.

According to the logs I am able to write into the port but am not able to read from the port..

Any one can help to fix the issue




WriteReadSerialPort.java







Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

Do you have anything plugged into the port?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
anitha meena
Ranch Hand

Joined: Oct 22, 2007
Posts: 40
Hi Joe Ess,

Thanks alot for your , I Have nothing is plugged into the port.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8877
    
    8

If nothing is plugged in, you can't really read anything. You may be able to set your port to local loopback but it's been a long time since I've worked with serial ports and I've never used RXTX to do it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading/writing from/to serial port