473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

java.comm

178 100+
Hi,

I am trying to get setup to write a realtime program for serial port communication. Problem im having is that sun say that java.comm is no longer available and that rxtx site just baffles me. I tried downloading several of the files but the zip folders where empty. Is there an alternative that anyone can recomment or even a sample script that someone has developed?
Aug 11 '08 #1
6 1878
JosAH
11,448 Expert 8TB
Hi,

I am trying to get setup to write a realtime program for serial port communication. Problem im having is that sun say that java.comm is no longer available and that rxtx site just baffles me. I tried downloading several of the files but the zip folders where empty. Is there an alternative that anyone can recomment or even a sample script that someone has developed?
So I noticed: they've made a bit of a mess out of it; all you need are three files:

1) RXTXcomm.jar: the Java api identical to Sun's API
2) rxtxParalel.dll: parallel port support library
3) rxtxSerial.dll: serial port support library.

The two dlls belong in the bin directory of your JRE and the jar can be convenienty
stored in the lib\ext directory of that same JRE. I still have those files from the
2.1.7 distribution but I have no idea how to get them across; I don't have any
web space anymore ... maybe you can open up your email address and close
it again after you've received those three files (total: 182KB)

kind regards,

Jos
Aug 11 '08 #2
cleary1981
178 100+
Thanks, that should be my email open now.
Aug 11 '08 #3
cleary1981
178 100+
yeah I got those ok. Thanks Jo
Aug 11 '08 #4
JosAH
11,448 Expert 8TB
yeah I got those ok. Thanks Jo
Good; remember: stick those dlls in your jre bin directory and that jar in your
jre lib\ext directory (or anywhere on your classpath). The packages are in the
gnu namespace as in:

Expand|Select|Wrap|Line Numbers
  1. import gnu.io.CommPortIdentifier;
  2. import gnu.io.PortInUseException;
  3. import gnu.io.SerialPort;
  4. import gnu.io.UnsupportedCommOperationException;
  5.  
All the rest of the code is identical to Sun's implementation and you can use
Sun's API documentation for it.

kind regards,

Jos
Aug 11 '08 #5
cleary1981
178 100+
I dont suppose you have any code that I could use to check my installation is correct?
Aug 11 '08 #6
JosAH
11,448 Expert 8TB
I dont suppose you have any code that I could use to check my installation is correct?
you can try something like this for starters:

Expand|Select|Wrap|Line Numbers
  1. Enumeration locPortList = CommPortIdentifier.getPortIdentifiers();
  2.  
  3. while (locPortList.hasMoreElements()) {
  4.  
  5.     CommPortIdentifier locPortId= (CommPortIdentifier) locPortList.nextElement();
  6.     System.out.println(locPortId.getName()+" serial: "+(locPortId.getPortType() == CommPortIdentifier.PORT_SERIAL));
  7. }
  8.  
It should give you a list of installed serial ports.

kind regards,

Jos
Aug 11 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dominik Kaspar | last post by:
hello i am writing a java program for locating a wireless device within an office environment. i want to use the signal strengths of the surrounding base stations (access points) to estimate the...
2
by: Mike C. | last post by:
I am trying to get Java v1.4.2 to use my PCI add-on serial port. So far, everything I try gives me javax.comm.NoSuchPortException at...
0
by: Greg Pedder | last post by:
Hello. I have an application that uses the Java Communications API to use a modem. At startup, the application checks to see what serial devices are connected. For each serial device, the app...
1
by: Dan | last post by:
I wnat to see in browser an status from an device connected on rs232 port The java class for read from serial port is: //Serial.java import java.io.*; import java.util.*; import...
7
by: Michael Chong | last post by:
I wrote a program that communicate with SerialComm. In every 300 milliseconds, my program continuously send & receive data via the serial port once the program starts. My program is once in a...
2
by: luthriaajay | last post by:
I have a tricky situation, So please any help will be appreciated. I have 2 XML docs : Document 1 ---------- <Interest>
3
by: suryawati | last post by:
Dear All, I am running a java serial program ( Black Box on commapi package ) on a Linux. But when Main Menu can displayed, automatically program stop for running and I can't do anything with...
66
by: flarosa | last post by:
Hi, I'm wondering if I can get a reasonably civil (without starting any huge wars) opinion on how server-side PHP compares to server-side Java. I've been strictly a Java developer for almost...
1
by: Jollywg | last post by:
I'm running a small program that should list all of the comm ports that are available on the computer. The only problem is that nothing is recognized. I've stepped through the program and it jumps...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.