Serial Communication API

Can anyone recommened any API's that can be used to read and write to Serial ports? I have looked into Java Communication API but this is depricated and I would prefer not to use it. I have also tried RXTX but this is a little buggy.
Any others out there? Would prefer a Windows/Linux multiplateform solution but if not just a Windows one is fine.
Thanks,

Yeah, I know that's what you 'should' do, but a user doesn't always do what you expect they 'should' do. So if a user does pull out the USB cable before the application is shut down and the COM port is closed, then the error appears. Isn't there a way to catch that exception?
Best regards,
RoDeNtJe

Similar Messages

  • Problem download: Java serial communication

    Hi,
    I need to work with Java serial communication api for Windows.
    As mentioned on SUN site, downloaded the following:
    1) comm2.0.3.zip, &
    2) rxtx-2.0-7pre1-i386-pc-mingw32.zip
    Extracting, unable to see win32com.dll & javax.comm.properties
    Can you help me?
    Thanks,
    Priya

    Hi priya
    There is problem in your downloaded s/w
    Download commAPI once again then try
    Read the readme file and follow the instruction

  • About Java Communication API for Windows

    hi
    I'm studying Serial Communication in university.
    I'd like to know the reason why we can't downlaod Java Communication API for Windows.
    I confirmed Comm for Linux and Soralis, but I can't find Comm for Win.
    Please tell me the reason if someone know.

    For no particular reason Sun stopped supporting the windows version
    of that package. I use rxtx which happens to allow for much faster
    communication too.
    The interface is identical to Sun's version, just the package differs: "gnu.io".
    kind regards,
    Jos

  • Problem with Java Communication API

    hi
    I installed the Java Communication API on win32 platform (as per the guidelines)
    Now when I try to run the sample program 'Blackbox' for the serial port, I get an error (in fact an exception is generated inside main function in BlackBox.class file)
    I tried the SimpleRead.java example but that too generated the same exception
    Can anybody help me out.... I am a novice with Java Comm API

    I tried running the sample BlackBox program provided for serial port and now it says
    No Serial Ports Found!
    I verified that both comm.jar and javax.comm.properties are in the <JDK>\lib directory.
    Actually, I am using netBeans IDE 1.4 and I used the C:\J2SDK folder installed with netBeans for the Java Communicaion API
    plz help.

  • Communication API for Linux

    I want to develop an application in Java for Linux that uses serial port .
    But java.sun.com provides communications API for Windows, Solaris but not Linux ! ! !
    Where can I find free java api to drive a serial port easily ???
    Thanks a lot

    I think you can do this using the version for Solaris/SPARC along with RXTX for Linux (do a search on google), also I think IBM did a JavaCOMM api for linux.

  • Hurry! Communication API's Application?

    Hello everyone!
    I have some questions for java.lang.object and javax.comm.*.
    I have edited a serial communication program which use jb7.0e to act a serial equipment.
    That program is used java's communication API. And I do it well in my computer.
    But when I make it into application program, always has one error trouble me...:
    java.lang.NullPointerException
    at adx.SerialBean.WritePort(SerialBean.java:125)
    at adx.App1.<init>(App1.java:51)
    at adx.App1.main(App1.java:114)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.zerog.lax.LAX.launch(Unknown Source)
    at com.zerog.lax.LAX.main(Unknown Source)
    I send the SerialBean.java at the end of the message.
    Would you show me a right way.
    Waiting for your early reply!
    Yours, telerich
    2002-11-22
    SerialBean.javaimport java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class SerialBean
    static String PortName;
    CommPortIdentifier portId;
    SerialPort serialPort;
    static OutputStream out;
    static InputStream in;
    SerialBuffer SB;
    ReadSerial RT;
    public SerialBean(int PortID)
    PortName = "COM" + PortID;
    public int Initialize()
    int InitSuccess = 1;
    int InitFail = -1;
    try
    portId = CommPortIdentifier.getPortIdentifier(PortName);
    try
    serialPort = (SerialPort)
    portId.open("Serial_Communication", 2000);
    } catch (PortInUseException e)
    return InitFail;
    try
    in = serialPort.getInputStream();
    out = serialPort.getOutputStream();
    } catch (IOException e)
    return InitFail;
    try
    serialPort.setSerialPortParams(19200,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e)
    return InitFail;
    } catch (NoSuchPortException e)
    return InitFail;
    SB = new SerialBuffer();
    RT = new ReadSerial(SB, in);
    RT.start();
    return InitSuccess;
    public String ReadPort(int Length)
    String Msg;
    Msg = SB.GetMsg(Length);
    return Msg;
    public void WritePort(String Msg1)
    int c;
    try
    for (int i = 0; i < Msg1.length(); i++)
         {System.out.print(Msg1.charAt(i));
    out.write(Msg1.charAt(i));}
    } catch (IOException e) {}
    public void ClosePort()
    RT.stop();
    serialPort.close();
    }

    You do know what a NullPointerException is, right? In line 125, in the WritePort-method, you try to access a variable that is null. The way you have posted your code I can't see which line that is, so it's hard for me to say anything more, (use code tags next time) but it is probably something rather straigthforward that you have forgotten. Carefully check all variables you use in that line to see if they are really initialised.

  • Serial communication : guidance wanted

    I've just been handed a project which will be my first attempt to have Java communicate via a serial interface.
    Some minimal research shows that there are several packages available that deal with this sort of thing. Is there one "official" package that they are all based on?
    I have the specs for a proprietary protocol I need to use. Not sure if this makes a difference regarding what packages to use.
    For this project, I also plan to use JUnit testing - my first attempt at that as well.
    Packages I'm currently contemplating:
    javax.comm (not sure if this is right, or where to find it)
    http://www.rxtx.org/

    "javax.comm" is the Java Communications API. It's the "reference implementation" which means it conforms to the specification (on a couple of platforms) but that's all. Here's the Sun page about it where you can download it. I have used it and it works fine for basic things (I just read input from a barcode scanner, no output). The RTXT product seems to be in active development and it runs on other platforms. I don't have any experience with it.
    Your "protocol" is probably a higher-level protocol that says something like "Send these bytes, then wait for some other bytes to come back". Whereas the packages deal with the lower-level RS232 protocol which talks about voltages and pins. So it won't make a difference what implementation you choose, I don't think.

  • Communication API and Linux

    But... exists an implementation of Communication API for linux?

    But... exists an implementation of Communication API
    for linux?http://www.google.com/search?q=javacomm+for+linux
    First hit:
    Java Comm Serial API How-To for Linux
    http://wass.homelinux.net/howtos/Comm_How-To.shtml
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Communication API

    i have to develop a little program for my studies which deals with the communication api.
    my question: is there a possebility to find out if printer is connected to a serial port or not. any method that returns whether there is one or not...
    thx in advance

    Sun dropped the support on Windows' Comm-API.
    You could have a look at RXTX: [http://www.rxtx.org/]

  • Communications-API: Windows download missing

    Hi,
    I wanted to download the Communications API for accessing the serial port for Windows but the appropriate download seems to be got lost.
    At http://www.sun.com/download/products.xml?id=43208d3d there are downloads for Linux and Solaris only ... so does anybody know what happened with the Windows-version?
    Oxy
    PS: Sorry for double posting but the other category was really wrong for this topic...

    Thank you for the unfriendly answer.
    Btw: when do you have tried to search for that
    problem last time? You get hundreds of results that
    are related to the Comm-API somehow...http://onesearch.sun.com/search/onesearch/index.jsp?qt=javacomm+windows&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
    Second hit has all the info you ever might need.

  • How to send data using serial Communication

    I want to make serial communication using RXTXcomm.jar file.I was written the code.From this I got the list of serial ports avilable on pc but then after when I was tring to send command to machine which is attached to port it didn't gave any reply.
    Tell me that how to send command to port?

    This is how I do it:// open port, get ownership
    SerialPort serialPort= (SerialPort)portId.open(APPLICATIONNAME, timeout);
    // no framing and no threshold
    serialPort.disableReceiveFraming();
    serialPort.disableReceiveThreshold();
    // communication speed, parity, stopbits and databits
    serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
         SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
    // no handshaking or other flow control
    serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
    // timer on any read of the serial port
    serialPort.enableReceiveTimeout(TIMEOUT);
    // open streams for reading and writing
    InputStream is= serialPort.getInputStream();
    OutputStream os= serialPort.getOutputStream();... then you use the 'os' stream for writing and the 'is' stream for reading.
    kind regards,
    Jos

  • Java communication api for windows 64 bit

    Hi,
    I need communication api for windows 64 bit. Are these api's in developement?
    Thanks,
    Andrea Todeschini

    If you use version 2.0 of the rxtx library then it provides a complete implementation of the javax.comm package.
    Version 2.1 does not (its in the gnu.io namespace)
    // Try the following url
    http://users.frii.com/jarvi/rxtx/download.html
    matfud

  • Does the Communications API work with Studio 4

    I just installed Studio 4 along with the JDK. The Java version that I am running now is:
    java version "1.4.1_02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
    Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
    Running on MS XP.
    The Communications API seemed to work just fine on JDK 1.3 with Forte 1.0.
    I installed the Comm API as instructed and set my ClassPath:
    CLASSPATH=D:\PROGRA~1\s1studio_jdk\j2sdk1.4.1_02\lib\comm.jar;D:\MyProjects\java\GarxFace
    A call to:
    Enumeration portList;
    portList = CommPortIdentifier.getPortIdentifiers();
    does not yield any ports at all.
    Stranger yet, if I use the auto complete feature in the editor. For example if I type: m_PortID. then no members of PortID show up.
    But the code compiles just fine.
    Any idea what is going on?

    First I found the reason that the auto complete was not working. I had to mount the comm.jar file (you did not have to do this in Forte 1,0, just set the classpath). I thought that I had done that. That is the problem when you work late. ;)
    Here is a eexcerpt that I found on a search in another post:
    Copy javax.comm.properties to your <JDK>\lib directory.
    C:\>copy c:\commapi\javax.comm.properties c:\jdk1.1.6\lib
    The javax.comm.properties file must be installed. If it is not, no ports will be found by the system.
    Notice it says that "javax.comm.properties file must be installed"
    javax.comm.properties is indeed installed in my JDK lib subrirectory, but it is almost like it is not being found.

  • How do i open a new window? serial communication problem

    I am trying to make a serial communication interface, with changeable settings,
    but i wanted it to be that the settings to be openend in a new window, how am i able to do that.
    I tried to make a separate subvi, but unable to do that, here is my explanation in images and the vi files.
    -Just a student-
    Attachments:
    LVTerm.vi ‏50 KB

    Hello Nandha,
    SubVI's can be created by selecting the part that you want in the subVI and than select "create subVI" from the "Edit" menu.
    Or cut the selected part and open a new VI and paste in the code. Then you have to connect all the controls and indicators to your connector pane. To do this right click the icon in the upper right corner and "Show connector". Select a pattern that has enough connectors, my personal favorite is the 4x4x4. Select the wire tool and select a connector and then the control or indicator you want to connect. Try to keep controls to the left and indicator to the right.
    Now you have to figure out when you want to show the settings window. Is it necessary that the communication goes on during manipulation of the settings?
    Kind regards,
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • Changing the name of serial communication example in lab windows. Urgent help required

    I am using the example of getting data from rs 232 in lab windows. I want to use this in my final year project that's why I want to change its name that appears as  "serial communication example" how can I change its name and how can I make its exe file that will run on any system even without lab windows.
    How can I modify this example to save the data. I am very new to lab windows, I was using hyper terminal previously.

    I am not informed about the file format that hyperterminal uses.  However, CVI allows wiring to files.  To get a list of functions that deal with file handling, press <Ctrl-Shift-p> to get the "Find Function Panel" dialog.  Type in "file" and press the "Find" button.  This will open a list of funtions that contain "file" in their name.

Maybe you are looking for

  • Is the whole jar loaded for a single class?

    Hi, Hopefully this is an easy yes/no question. If my application makes reference to only a single class in a jar that has many other classes, does the entire jar (all the other classes) get loaded into memory? If so, then it's worth it to break the j

  • Problem with populating setup tables for purchasing

    I'm working on NW2004s. Problem: Setup tables are not getting populated for 2lis_02_hdr, 2lis_02_item.. what all i've done so far: 1. Activated Data Sources in RSA5. 2. In LO Data Extraction, all the extract structure are active. (btw in job control

  • Oracle error - oracle initializarion or shutdown in progress

    Hi Experts, When I tried to connect to oracle there was an error "oracle initializarion or shutdown in progress" then i tried the following steps and the results are as below. still i could not connect to oracle. Kindly suggest me a good solution. C:

  • [solved] new systemd-sysctl applies 99-sysctl.conf before networkd?

    Recently pacman updated systemd. I use systemd-networkd for Ethernet (wired) control (Wireless LAN is hard blocked) I have this in /etc/sysctl.d/99-sysctl.conf net.ipv4.ip_forward = 1 This is to allow sharing of internet where my system is gateway. T

  • Unable to open iPhoto library

    Macbook Air froze while in iPhoto. I was not able to shutdown properly and was forced to reboot using Ctrl-Alt-Del.  When restarted, I got a message about some database not properly synced, so I shut down properly & restarted.   When I opened iPhoto,