0

I'm trying to solve one problem with the "communication with RS232" port using Java, because my skills on C are not so great!

The problem:

I have a dynamometer (if you care what is the machine that I'm using) that send the data to my pc through RS232. The main idea is that when I send the ASCII code 'S' to it, the dynamometer should return me -

18 bytes as follows: 0,1,2,3,4 - the messured force F; 5,6,7,8,9 - Fmax; 10,11,12,13,14 - the messured speed dF/dT and bytes 15,16,17 - status (0/1 for each - MaxHold, Nulled, Overload). All the bytes are standard ASCII strings.

So my problem is that I will make the rest of the code, the loops for sending the 'S', the Null command to the machine at the beginning... I have no problems to safe this info into a file for example .txt either.

My problem is that I cant understand and I cant find maybe an already done and known method for simple sending/receiving commands or information through this RS232.

As far as I saw... I will have to use the class javax.comm that is not supported since... ages and the other way is to use rxtx libs that I cant find in google because it says to me that their webpage is somehow... not working. I'm afraid that there won't be any good doc for this lib and I will fail with the use whether I get it or not.

I know that my problem is not so easy maybe but this is part from my final educational exam and I really need help. I will appreciate it BIG TIME!

Thanks a lot from now on to the ppl that will try to help me!

PS: Sorry for my bad grammar.

Stuci
  • 23
  • 1
  • 1
  • 3
  • 2
    Your google (or internet) must be broken: http://rxtx.qbang.org/wiki/index.php/Main_Page – Brian Roach Feb 18 '13 at 23:55
  • 1
    We are getting rid of RxTx right now because of the following issue: if the data cable gets disconnected while there is an ongoing communication (eg. alive poll) RxTx crashes violently, causing the JVM to crash as well. So I'd rather take a look at Brian's Java Simple Serial Connector. – András Hummer Oct 17 '13 at 07:14
  • I recommend to undo all those downvotes that were done in the name of RxTx. It's neither the only possible solution, nor the Holy Grail for low level serial communication. It has some pretty nasty flaws. – András Hummer Oct 17 '13 at 07:17

1 Answers1

2

java-simple-serial-connector looks like a suitable alternative to RxTx

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440