using javax.comm with usb-serial port adapter

Discussion in 'Java' started by yakka, Aug 7, 2006.

  1. yakka

    yakka Guest

    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
     
    yakka, Aug 7, 2006
    #1
    1. Advertising

  2. yakka

    PaullyB Guest

    Re: using javax.comm with usb-serial port adapter

    yakka wrote:
    > 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
     
    PaullyB, Aug 7, 2006
    #2
    1. Advertising

  3. yakka

    yakka Guest

    Re: using javax.comm with usb-serial port adapter

    PaullyB yazdi:
    > yakka wrote:
    > > 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



    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
     
    yakka, Aug 8, 2006
    #3
  4. yakka

    jc9121

    Joined:
    Aug 17, 2006
    Messages:
    1
    GPS Reveiver and Javax

    Hi Paully B.
    Thanks for the info!

    jc
     
    Last edited: Jan 1, 2011
    jc9121, Aug 17, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Pedder
    Replies:
    0
    Views:
    686
    Greg Pedder
    Feb 8, 2004
  2. Andreas

    writing to serial port (COMM)

    Andreas, May 17, 2004, in forum: Java
    Replies:
    6
    Views:
    7,083
    blackmonk
    Nov 16, 2010
  3. =?ISO-8859-1?Q?St=E9phane?= Nufer

    serial, parallel and USB port

    =?ISO-8859-1?Q?St=E9phane?= Nufer, Jul 30, 2003, in forum: Python
    Replies:
    6
    Views:
    763
    Lonnie Princehouse
    Jul 16, 2004
  4. Replies:
    2
    Views:
    382
  5. LittleAlex
    Replies:
    0
    Views:
    432
    LittleAlex
    Sep 15, 2008
Loading...

Share This Page