Need faster serial port access

I am using javacomm for serial port communication and the performance is too
slow for my needs. I am comming with an embedded app from an NT machine
with my java app. For benchmark purposes I hava VB app that can also talk
to this embedded app. The round trip communication time for the VB app is
20-30 milliseconds but the java app takes ~200 milliseconds. I think I could
improve performance by writing to the serial port directly instead of going
through the javacomm api which I think is slowing me down. Is it possible to
to a low-level file open and write directly to the serial port? And if so, how?
Thanks,
Michael

I am using javacomm for serial port communication and
the performance is too
slow for my needs. I am comming with an embedded app
from an NT machine
with my java app. For benchmark purposes I hava VB app
that can also talk
to this embedded app. The round trip communication
time for the VB app is
20-30 milliseconds but the java app takes ~200
milliseconds. I think I could
improve performance by writing to the serial port
directly instead of going
through the javacomm api which I think is slowing me
down. Is it possible to
to a low-level file open and write directly to the
serial port? And if so, how?
Thanks,
MichaelSlowing down of communication process depends upon code content as well. if u can put ur code here, may be u can get some feedback concerned with speed.
you can not directly talk at a serial level but make a component in say C n can use native methods to access that component. But that component would be very much comparable to Win32com.dll.There would be speed difference but that difference would not be enough to warrant 'too much'
Jatin

Similar Messages

  • Low Level Serial Port Access

    This question has gone unanswered several times on this forum in the past but I thought I would try it once more.
    Is there any Java API that is in, or will work with J2ME to allow direct read and write to the serial port similar to the functionality that javax.comm provides for j2se.
    This would be useful for a project where a palmos device is used to communicate with equipment used to monitor industrial processes.

    Some MIDP 1.0 devices support access to the Serial
    Port.
    I have done it with Motorola i85, i50 (iDen) and
    Motorola T720i.
    I think 95cl also supports it. I'm ALSO having problems with serial port access on
    my T-Mobile Moto T720i phone. I've had MUCH success
    with the Nextel i85, i50, i95cl, etc phones, but the
    same code isn't running on the T720i.
    What do I need to do differently???
    Thanks,
    -Tim

  • Serial port access time slows in version 6 to 7 upgrade

    Hi - I am in the process of upgrading an project from LV 6 to LV
    7,  the serial port access works well in LV6 but after the
    upgrade, the serial port access is slow in LV if the application is
    compiled into an exe.  We are running Windows 2K on all machines
    and have installed the LV7.0 runtime engine on the PC that is running
    the executable.  If I run the application on a machine that has
    the full LV7.0 development  software on it, the executable runs
    just like it used to under LV6.0
    What am I forgetting??  The application is built into one exe that
    has all of the sub vi's included.  I have checked the box on the
    application builder that says included serial port support.
    Help! - We have 3000 PCBs sitting in manufacturing waiting to go to test until I solve this problem
    Thank you

    Hi
    I just recently finished a project in which I had to upgrade code from LV 6 to LV 7.1. After I did that the serial port actually worked but all the Fieldpoint devices that were connected to the system didn't work. The problem ultimately was the NI Fieldpoint Drivers. After I installed the newest drivers from NI everything worked perfectly. I don't know why your problem is occurring, but I wanted to reasure you that there isn't a problem with the serial ports when upgrading to LV7.1 (I don't know about LV7).BTW, I had LV6.1 development system installed on the computer, but didn't have the LV7.1 (All I had was an EXE file).
    So, try installing the newest drivers. Maybe that can help.
    Ami 

  • Hello Forum, you need a serial ports for software icprog to program EPROM and Pic

    Hello Forum, you need a serial ports for software icprog to program EPROM and Pic.I was wondering if this or a similar card is compatible with my Lenovo Desktop h50-50 -->  -> PCI-E 2 serial ports and 1 parallel port PCI-Controller Card 3 Port ► http://fli.zz.mu/cut/scheda-pci-e-2-porte-seriali-1-porta-parallela .
    My my Lenovo Desktop h50-50 upgrade to win 10,  If it is not compatible to win 10. I could use it too virtualizing win Xp? Thank since TIME FOR ANSWERS, I apologize for my bad English.
    THANK Joe  

    Unfortunately, no Sanyo phones are iSync compatible so you will not be able to synchronize your Contacts and Calendars with the phone.
    Also, you may have problems with the Bluetooth adapter you purchased, as the only one officially supported by Apple for use with Macs is the D-Link DBT-120.
    The Official Apple list of iSync compatible devices is here:
    http://www.apple.com/macosx/features/isync/devices.html
    It's always a good idea to check this list before purchasing a new phone.
    Other phones are supported by third party plugins from here and here. But still no Samsung, Sanyo, LG etc. who all use thier own proprietary syncing protocols rather than the industry standard SyncML. These manufacturers also don't provide Mac software with their phones like the do for Windows users.
    I'm afraid you're not going to have much luck if you stick with the Sanyo. I would seriously consider taking it back and swapping it for one of the handsets on the above linked pages. Personally I would recommend a Sony Ericsson model. I've always had excellent Mac compatibility with those.

  • Java enabled phones supporting serial port access

    Does anybody know a Java enabled mobile phone beside the Motorola iden family that supports access to the serial port ? As far as I can see there are no such phones on the market.

    simens sl45 and m50

  • Infrared / Serial ports access in MIDP for Palm

    Hello,
    Do you guys know if MIDP for Palm allows to connect to the IR / Serial ports ? If yes, any examples ?
    Thanks,
    Vadim.

    I'm very interested by your discussion, i have searched a lot of information about midp and the access to the serial port.
    The specifications of midp says that the comm protocol is not available in midp.
    The IBM J9 Java VM is supposed to be full midp implementation but only only for x86 processors. The lcdui package is not available with the J9 VM for palm. The lasts contact i have with ibm about this subject, they said that they will implement lcdui but they can't say when .... perhaps in 2002.
    I don't know any other Java VM witch have a full midp implementation ... Kada VM will be but i don't know when ...
    If you have any other information, i'm very interested
    Thanks by advance

  • After Effects scripting: Serial port access?

    Hi,
    Does any one know if it's possible to access the computer's serial port using an After Effectsc script?
    I'm building a motion control script and I'm wondering if I can use a script to read the values of a keyframed parameter(e.g. a slider effect on a solid layer) to send serial port commands to move my rig.
    Regards,
    Ihab Ali

    I don't think that ExtendScript for AE ships with a way to do that out of the box, but in the Javascript Tools Guide for CS5, there is a section titled "Integrated External Libraries" which reads:
    You can extend the JavaScript DOM for an application by writing a C or C++ shared library, compiling it for the platform you are using, and loading it into JavaScript as an ExternalObject object. A shared library is implemented by a DLL in Windows, a bundle or framework in Mac OS, or a SharedObject in UNIX.
    You can access the library functions directly through the ExternalObject instance, or you can define an interface that allows your C/C++ code to create and access JavaScript classes and objects.
    All Adobe Creative Suite 4 applications support this feature.
    So you can probably write an app in C or C++ which communicates directly to the machine's port, and then call functions you declare in that code via ExtendScript.  Sorry I couldn't be of much help here, but that's where I would start.
    --Arie

  • Help needed in serial port connection

    I tried to write a midlet such that an emulator can get images from a webcam which shall is attached to the serial port of a cell phone. But I always get the following error message:
    IOException:javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist comm:0;baudrate=9600
    My code appears as follows:
    InputConnection cc;
    DataInputStream inc;
    static byte img_data[];
    static int frame_len = 30000;
    public void start()
    try
    System.out.println("I am here:");
    cc = (StreamConnection)Connector.open("comm:0;baudrate=9600");
    //************* I can't pass through here
    //I also try to use
    //cc = (StreamConnection)Connector.open
    //("comm:0;baudrate=9600;bitsperchar=8;stopbits=1;parity=none");
    // to do it, but get same problem
    inc = new DataInputStream(cc.openDataInputStream());
    inc.readFully( img_data);
    catch (IOException e)
    {   System.err.println("IOException:" + e);  }
    finally
    // free up the I/O stream after use
    try { if (inc != null ) inc.close(); }
    catch (IOException ignored) { System.err.println ("Exception:" + ignored); }
    // free up the connection after use
    try { if ( cc != null ) cc.close(); }
    catch (IOException ignored) { System.err.println("Exception:" + ignored); }
    System.out.println("I am ok:");
    Does anybody know some reasons that probably lead to this error.
    thanks in advance

    well, as i know, midp 1.0 does not support serial connections, actually, any connection type other than http connection.
    this is my problem noeadays too, is it practically possible to use serial connection under midp.
    have you had any improvements since than?

  • Serial Port Access

    Hey,
    How do I read data from the COM3 port on my computer. I have the javax.comm thing all setup but need to figure out how the data comes in from a device plugged into that port. Having the data display on the fly as they are being read should be explained please. Thanks a lot.

    Hey,
    Have a look at this example:
    http://java.sun.com/products/javacomm/javadocs/SimpleRead.java
    You need to adjust some things though.
    Hope this helps.

  • USB and serial port access in java

    Hi
    I have a magstripe card reader connected to my computer with a USB interface (port).
    I am using javax.comm API to get the card swipe data but could not succeeded.
    Can i do that or have to do something else ???

    ok. Below is my code:
    this is a sample code come with the API.
    package msr;
    * @author Dell
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    * Class declaration
    * @author
    * @version 1.8, 08/03/00
    public class SimpleRead implements Runnable, SerialPortEventListener {
        static CommPortIdentifier portId;
        static Enumeration           portList;
        InputStream                inputStream;
        SerialPort                serialPort;
        Thread                readThread;
         * Method declaration
         * @param args
         * @see
        public static void main(String[] args) {
        boolean                portFound = false;
        String                defaultPort = "COM3";
         if (args.length > 0) {
             defaultPort = args[0];
         portList = CommPortIdentifier.getPortIdentifiers();
         while (portList.hasMoreElements()) {
             portId = (CommPortIdentifier) portList.nextElement();
             if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
              if (portId.getName().equals(defaultPort)) {
                  System.out.println("Found port: "+defaultPort);
                  portFound = true;
                  SimpleRead reader = new SimpleRead();
         if (!portFound) {
             System.out.println("port " + defaultPort + " not found.");
         * Constructor declaration
         * @see
        public SimpleRead() {
         try {
             serialPort = (SerialPort) portId.open("SimpleReadApp", 2000);
         } catch (PortInUseException e) {}
         try {
             inputStream = serialPort.getInputStream();
         } catch (IOException e) {}
         try {
             serialPort.addEventListener(this);
         } catch (TooManyListenersException e) {}
         serialPort.notifyOnDataAvailable(true);
         try {
             serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
                                SerialPort.STOPBITS_1,
                                SerialPort.PARITY_NONE);
         } catch (UnsupportedCommOperationException e) {}
         readThread = new Thread(this);
         readThread.start();
         * Method declaration
         * @see
        public void run() {
         try {
             Thread.sleep(20000);
         } catch (InterruptedException e) {}
         * Method declaration
         * @param event
         * @see
        public void serialEvent(SerialPortEvent event) {
         switch (event.getEventType()) {
         case SerialPortEvent.BI:
         case SerialPortEvent.OE:
         case SerialPortEvent.FE:
         case SerialPortEvent.PE:
         case SerialPortEvent.CD:
         case SerialPortEvent.CTS:
         case SerialPortEvent.DSR:
         case SerialPortEvent.RI:
         case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
             break;
         case SerialPortEvent.DATA_AVAILABLE:
             byte[] readBuffer = new byte[20];
             try {
              while (inputStream.available() > 0) {
                  int numBytes = inputStream.read(readBuffer);
              System.out.print(new String(readBuffer));
             } catch (IOException e) {}
             break;
    }

  • Help needed, example (serial port) streams module not working.

    I am trying to make work the tblt.c example of a streams module on Solaris 8.
    This sample is the one provided by Sun in it's Driver Dev. Kit.
    My test program gets blocked in the I_PUSH ioctl (after having successfully
    poped ttcompat and ldterm).
    Debug prints in the module tell me that the tbltopen() stays in the loop
         * Now wait for it. Let our read queue put routine wake us up
         * when it arrives.
         while (tbltd->tbltd_flags & TBLT_IOCWAIT) {
              if (!qwait_sig(q)) {
                   lwp_error = EINTR;
                   goto error;
    done, after
    iocb = (struct iocblk *)mp->b_wptr;
         iocb->ioc_count = sizeof (struct iocblk);
         cb = (struct termios *)datap->b_wptr;
         cb->c_iflag = 0;
         cb->c_oflag = 0;
         cb->c_cflag = CREAD|CS8|B9600;
         cb->c_lflag = 0;
         bzero((caddr_t)cb->c_cc, NCCS);
         datap->b_wptr += sizeof (*cb)/(sizeof (*datap->b_wptr));
         mp->b_cont = datap;
         tbltd->tbltd_flags |= TBLT_IOCWAIT;     /* indicate that we're */
         tbltd->tbltd_iocid = iocb->ioc_id;     /* waiting for this response */
         (void) putnext(WR(q), mp);
    (used to set baudrate, I suppose)
    and only a Ctlr-C of my test prog. makes it return via
    lwp_error = EINTR;
                   goto error;
    A few years ago, I had no trouble with the same Solaris 5 example.
    and my hardware (tablet + cable) works fine on a Solaris 5 system.

    darren,
    thanks for your help here and over on comp.sys.solaris. ultimately the problem was portmon on ttya, and i think i know how it happened. the machine was set up with a keyboard and monitor, and ttya was enabled using admintool. later, with the machine headless, the console was changed over to ttya via eeprom, which produced the conflict i noted above.
    solution:
    # pmadm -l
    PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC>
    zsmon ttymon ttyb u root /dev/term/b I - /usr/
    bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
    zsmon ttymon ttya u root /dev/term/a - - /usr/
    bin/login - 9600 ldterm,ttcompat neo ttya login: - vt100 y #Terminal
    # pmadm -d -p zsmon -s ttya
    # pmadm -l
    PMTAG PMTYPE SVCTAG FLGS ID <PMSPECIFIC>
    zsmon ttymon ttyb u root /dev/term/b I - /usr/
    bin/login - 9600 ldterm,ttcompat ttyb login: - tvi925 y #
    zsmon ttymon ttya ux root /dev/term/a - - /usr/
    bin/login - 9600 ldterm,ttcompat neo ttya login: - vt100 y #Terminal
    # echo $TERM
    sun-color
    # svccfg
    svc:> select system/console-login
    svc:/system/console-login> setprop ttymon/terminal_type = "vt100"
    svc:/system/console-login> exit
    # echo $TERM
    vt100
    also see
    http://www.bordergatewayprotocol.net/jon/helpful_stuff/solaris/solaris-advanced-sysadmin-guide/ch09/181-186.html

  • Access serial port through AIR

    isnt there any extensions or API buit for accessing serial
    port from AIR.
    i am designing a vending machile applicaton in which a coin
    drop is detected and corresponding images or message is displayed.
    MDM Zinc 3.0 allows serial port access but worths more than
    what it deserves. does AIR has some similar functionality.
    Any help.

    I'm not too hot on this subject, but would it not be possible
    to use Binary Sockets to connect to another app on the machine that
    could connect to a serial port?

  • Help with reading information coming from a software into LabVIEW through Serial port

    Hi,
    I am new to LabVIEW and also an amateur in using RS232 for communication. I have this software that has these icons like speed increase/decrease, elevation up/down, start/stop. Now, when I click these buttons on the software, they perform the appropriate functions. For example, if I press start button, the signal must go through a serial COM port into LabVIEW to start the machine. How do I do that? How do I find what format the code word is when I press a button on the software? And how to decode the information to read whether the button pushed is start etc...? Any help would be appreciated.

    I may not be perfect, but I'm all I got!

    That information would be in the programming manual for the device you're controlling. Unless you have a device that has no documentation or you cannot get the documentation that's the first place you should look. If you cannot get the documentation at all then you've got some reverse-engineering to do. To do this you will either need a serial port sniffer (a hardware device), or you can try to use a software-based port capturing program. On Windows PortMon is the most prevalent. This will show you how the port was configured (baud rate, stop bits, etc). Warning: the information is technical.
    As far as how to get it running in LabVIEW, you should take a look at the serial port communication examples that ship with LabVIEW. The most problems occur in figuring out how to (a) terminate a write command, and (b) determining when to stop reading. For (a) this is typically done by appending a carriage return or linefeed to the command. This is device dependent. For (b) this is usually done by the byte stream ending with a character like a linefeed. Again, this is device-dependent. 
    You may also want to peruse this KB article: Serial Instrument Control Tutorial. There are also lots of tutorial on the internet for basic tutorials on serial port communication.

  • How can I read the voltage from a serial port

    I am fairly new to LabView and I am having trouble figuring out how to read the DC voltage coming out of an RF Power Supply through a serial port so that I can monitor the voltage every few seconds. In order to do this do I need to purchase a DAQ card or anything like that?

    You would not need a DAQ card to read data over the serial port. You would, however, need a serial port. That may sound sarcastic, but it's not, since many manufacturers are ditching serial ports on computers. If you don't have a serial port then you would need to get something like a USB<->serial adapter or a serial port card that you plug into an expansion slot in your computer.
    Assuming you've got that then you need to find the command set for the RF Power Supply, and write drivers for it so you can send the command to read the voltage, and then read the resposen. I would suggest looking in the Instrument Driver Network to see if a driver for your supply has already been written. 

  • Usb to serial port converter in lenova g560

    hi this is madhan. i m using lenova g560 ideapad. there is no serial port in my laptop. For my project i need a serial port. i heard tat in market USB to serial port converters are available. Does Lenova g560 support this change?? If so is there any driver to make support to serial port?????????

    If you buy a Serial-USB interface/cable you won't have any problem. Usually this accesory comes with drivers. If you have Windows 7, mayte it will detect all automaticaly.
    Regards.
    IPnaSh
    First Spanish Community Guru - Colaborador ad honorem

Maybe you are looking for

  • Running 9.5.1 on new iMac running 10.8.2. Got message to update to 9.5.4, but it won't work

    Running Acrpbat 9 Pro 9.5.1 on new iMac with OS 10.8.2. Got message to install update 9.5.4. Won't work. Says my original version has been modified. I tried to uninstall 9.5.1, but it won't even let me do that.

  • Enq : TX row lock contention with no lock holder !!

    Hi, all. The database is 2 node RAC (oracle 11.2.0.3 ) on a unix machine. Today morning, I found the instances sufferred "enq : TX row lock contention" YESTERDAY. I issued the following query, but block_session, blocking_session_serial# and blocking_

  • Conditions payment for my Craiglist item - Fraud?

    Is this email wanting me to ship my merchandise a fraud? PayPal logo 8 Dec 2014 Transaction ID: 3W492637HE3368307 Hello (my papal user name) You have an instant payment of $400.00 USD from Joshua Brown(ericwilli52...his email address) Note to seller

  • Import  oracle forms into portal

    Can anyone please give me some pointers in importing forms created by orcale forms into portal?

  • What "umod 8" stands for

    Hello In a note I have warning to : "import the transport from the attachement as client dependant with umod 8 (as this transport belongs to customizing requests)" However when trying in stms to import an request I do not have option umod 8 (what doe