ImageJ & serial port communication

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageJ & serial port communication

Markus Antoschak
Dear users,

i've a problem to communicate with my serial port. I use the RXTX package
and it works fine with some Applets but it doesn't work in an ImageJ-Plugin.
I want to send a char 'q' to my ASURO-Robot (www.arexx.com). A red LED
should blink but it doesn't. Do i forget something?  

Here is a snap of my code:


static CommPortIdentifier portID;
int b = 'q';
static SerialPort      serialPort;
static OutputStream       outputStream;

....
...
..
try {
    portID = CommPortIdentifier.getPortIdentifier("COM1");
}catch (NoSuchPortException port){}
try {
    serialPort = (SerialPort) portID.open("mein_programm",2000);
}catch (PortInUseException portuse){}
try {
    outputStream = serialPort.getOutputStream();
}catch (IOException io){}
try {
    serialPort.setSerialPortParams(2400, SerialPort.DATABITS_8,            
               SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
}catch (UnsupportedCommOperationException e){}
try {
    outputStream.write(b);
}catch (IOException ou){}
serialPort.close();

Best regards :)

Markus
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ & serial port communication

Vincenzo Della Mea
You could give a try at our IJSerial plugin: http://www.eslide.net/ 
ijstage.php

Regards,
Vincenzo
Il giorno 10/set/06, alle ore 22:25, Markus Antoschak ha scritto:

> Dear users,
>
> i've a problem to communicate with my serial port. I use the RXTX  
> package
> and it works fine with some Applets but it doesn't work in an  
> ImageJ-Plugin.
> I want to send a char 'q' to my ASURO-Robot (www.arexx.com). A red LED
> should blink but it doesn't. Do i forget something?

* Vincenzo Della Mea
* Medical Informatics, Telemedicine and Ehealth Lab
* University of Udine, Italy
* http://mitel.dimi.uniud.it/  -  http://www.eslide.net
Reply | Threaded
Open this post in threaded view
|

AW: ImageJ & serial port communication

Markus Antoschak
Thanks, i will try it.

Regards,

Markus

-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von
Vincenzo Della Mea
Gesendet: Montag, 11. September 2006 09:32
An: [hidden email]
Betreff: Re: ImageJ & serial port communication

You could give a try at our IJSerial plugin: http://www.eslide.net/ 
ijstage.php

Regards,
Vincenzo
Il giorno 10/set/06, alle ore 22:25, Markus Antoschak ha scritto:

> Dear users,
>
> i've a problem to communicate with my serial port. I use the RXTX  
> package
> and it works fine with some Applets but it doesn't work in an  
> ImageJ-Plugin.
> I want to send a char 'q' to my ASURO-Robot (www.arexx.com). A red LED
> should blink but it doesn't. Do i forget something?

* Vincenzo Della Mea
* Medical Informatics, Telemedicine and Ehealth Lab
* University of Udine, Italy
* http://mitel.dimi.uniud.it/  -  http://www.eslide.net