Usage of Serial Com Port communication

Discussion in 'Java' started by calvinlyp, Feb 20, 2010.

  1. calvinlyp

    calvinlyp New Member

    Joined:
    Jun 4, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,

    currently i am trying to use a java app to read from my usb to serial port on my PC.

    i research and found that Windows COM ports are not directly supported by Sun anymore. thus there is another package called rxtx.

    http://www.captain.at/howto-java-ser...-comm-rxtx.php
    i tried the above link with my app, however it return me portId=null;

    from the link below:(New Windows Java Serial Com Port driver with proper handling of Timeouts)
    http://www.engidea.com/blog/informat...m/winjcom.html

    it stated that the usb to serial maybe a problem when using the rxtx package, and this winjcom maybe a good substitute.

    however, is there any expertises can share their advice on how to use this winjcom.

    thanks in advance.
    any help will be greatly appreaciated.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved your attachment into the post
     
  3. ewaldhorn

    ewaldhorn New Member

    Joined:
    Feb 16, 2010
    Messages:
    36
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    Cape Town, South Africa
    Home Page:
    http://www.javak.co.za
    Hi.

    I've had mixed success with using COM ports on Windows through Java. What I'd recommend is that you find a good C/C++ DLL you can use and then using JNI (Java Native Interface) to call it and do what you need to do.

    Could you explain the USB to COM thing though? Do you want to read directly from the USB device or treat it like a COM port?

    Thanks
    Ewald
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice