Can I build a full-duplex serial port?

I want to build a full-duplex serial port with PCI-6533, main features are:
software: LabView
hardware: PCI-6533
serial port: full-duplex,synchronized
clock: 13MHz, external feed
control lines: 3
data: about 1k bytes to be transfered
Thanks and best regards,

You can build it, but it won't be easy. Transmitting should be OK. But, for receiving, you are going to have to parse the information out of your incoming bitstream to get the information from the frame.
Also, there is a peculiarity when usng the 2 timing sections together on the 6533. If you use any data width greater than 8 bits, you are only going to get 10MHz on each 'side', since the data has to be split between them by word. However, since you are serial and only using one bit, you don't have to worry.

Similar Messages

  • How can i browse FP 2000 via serial port same use Ethernet port(RJ 45)?

    I am a new user for  labview.I develope my program with FP 2000 but I have some problem
      1 How can i browse FP 2000 via serial port same use Ethernet port(RJ 45)? if it can Tell me please.
      2 If  I use GSM/GPRS modem via FP 2000 rs 232 port (I under stand how to send AT command) and leave it stand alone
         Can I dial modem and browse file in FP 2000 same as use Ethernetport?
    Someone please help me.Thank you very much.

    Hi!
        First, I can say that your project involves many things, I cannot describe all features in the forum, and I'm not used with GPRS modems (my modems are base band serial modems...).
        Anyway, I would say that in your project you should proceed like this:
          1) Configure your FP 2000 module via MAX and ethernet connection;
          2) Download an embedded application to your module (build in LabView Real-Time)
          3) In your application, you should build a kind of serial port manager, and by the means of serial port you send/receive commands from PC.
        The commands from PC can include "Tell me the about the FP 2000 file system ", or "switch on line X", or anything you need.
       I think it would be difficult to use Internet exp, because you use IE with TCP/IP, and TCP/IP is over ethernet.
       I know that for Windows you can find some wrappers that make you "see" the serial port as an ethernet, but these wrapper do not exist under filed Point, and you shoul build one yourself!!!(and that's not easy).
        For example, to browse your files, you should build a VI that searches through your file system, and reports, via serial, the files present in a directory (it's an example....).
        About communication between GPRS modems and FP2000, I know nothing.  I suppose that these modems accept serial inputs, so you'll have to configure your serial port on FP 2000 with the correct baud rate, parity, and so on..... and you send your data to the modem.  The modem will transfer data in its way, no matter on how it does.
        To send data to your modem you shoud take a look to some Serial communication examples.  What I suggest you, first, is to connect the serial port of FP2000 to a PC, and test communication between PC and FP2000, without modems. Just direct cable connection!  If you're able to do this, insertion of modems is the next step, and should be quite easy.  If you're not able to make the PC receive strings of data from FP2000, over  RS232, adding modems is a further complication, and you won't come out of this mess!
       So, what I say, is just build, for now, a simple embedded application for FP2000, that, using RS232, sends data to a PC (you should see data sent with use of Hyper terminal).
        To build this application, use Instrument I/O --> VISA commands (VISA open, VISA write, and Property node should be enough, for now).
       Please, let me know if this helps......
        Have a nice (programming) day!
    graziano

  • Can air for html/ajax accessing serial port or usb?

    I just have made use of Adobe AIR .I want to use printer with
    air . Do air have some poperties to accessing serial port or usb?
    I look up that on the Adobe AIR documents.I only found
    'Adobe® AIR™ provides the eans to check for changes to
    the network connectivity of the computer on which an AIR
    application is installed'.
    Do you have some demo with Adobe AIR accessing serial port or
    usb ?
    Or has another poperties to do that!
    thank you!!

    There is no API for accessing the serial port. USB devices
    can only be accessed through the file system (and only if they are
    storage devices).

  • Can't build splashy-full package an my machine

    As th subject tells, i'm not able to build the splashy-full package on my arch-machine.
    I alwys get the following error:
    splashy 0.3.13
    Print debugging messages...... :
    configure complete, now type 'make'
    make all-recursive
    make[1]: Entering directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13'
    Making all in po
    make[2]: Entering directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/po'
    make[2]: Für das Ziel »all« ist nichts zu tun.
    make[2]: Leaving directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/po'
    Making all in doc
    make[2]: Entering directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/doc'
    make[2]: Für das Ziel »all« ist nichts zu tun.
    make[2]: Leaving directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/doc'
    Making all in src
    make[2]: Entering directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/src'
    if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/directfb -march=i686 -mtune=generic -O2 -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -MT xml_parser.lo -MD -MP -MF ".deps/xml_parser.Tpo" -c -o xml_parser.lo xml_parser.c; \
    then mv -f ".deps/xml_parser.Tpo" ".deps/xml_parser.Plo"; else rm -f ".deps/xml_parser.Tpo"; exit 1; fi
    gcc -DHAVE_CONFIG_H -I. -I. -I.. -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/directfb -march=i686 -mtune=generic -O2 -pipe -Wall -Werror -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -MT xml_parser.lo -MD -MP -MF .deps/xml_parser.Tpo -c xml_parser.c -fPIC -DPIC -o .libs/xml_parser.o
    xml_parser.c: In Funktion »xml_parser_xpath_pop«:
    xml_parser.c:94:25: Fehler: Variable »_last« gesetzt, aber nicht verwendet [-Werror=unused-but-set-variable]
    xml_parser.c: In Funktion »xml_parser_stack_pop«:
    xml_parser.c:109:21: Fehler: Variable »_last« gesetzt, aber nicht verwendet [-Werror=unused-but-set-variable]
    cc1: Alle Warnungen werden als Fehler behandelt
    make[2]: *** [xml_parser.lo] Fehler 1
    make[2]: Leaving directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13/src'
    make[1]: *** [all-recursive] Fehler 1
    make[1]: Leaving directory `/tmp/yaourt-tmp-root/aur-splashy-full/src/splashy-0.3.13'
    make: *** [all] Fehler 2
    ==> FEHLER: Ein Unfall geschah in build().
    Breche ab ...
    ==> ERROR: Makepkg was unable to build splashy-full.
    ==> Restart building splashy-full ? [y/N]
    ==> -------------------------------------
    ==>
    ==> WARNING: Following packages have not been installed:
    splashy-full
    What am i doing wrong? How can i solve this?
    Thx for your help & ideas!

    easy to solve the problem, add the following to the PKGBUILD:
        sed -e 's| -Werror||g' \
            -i "${srcdir}/splashy-${pkgver}/Makefile" \
            -i "${srcdir}/splashy-${pkgver}/configure" \
            -i "${srcdir}/splashy-${pkgver}/configure.ac"
    add it to the build() function,
    just before 'make'

  • [SOLVED] can't build firefox - full perl install required

    Hi Archers,
    Here's the error message i get when i try to build Firefox :
    checking for perl... /usr/bin/perl
    checking for minimum required perl version >= 5.004... 5.008008
    checking for full perl installation... no
    configure: error: Cannot find Config.pm or $Config{archlib}. A full perl installation is required.
    *** Fix above errors and then restart with "make -f client.mk build"
    make[1]: *** [configure] Error 1
    make[1]: Leaving directory `/home/eb/pkg/firefox/src/mozilla'
    make: *** [/home/eb/pkg/firefox/src/mozilla/config.status] Error 2
    ==> ERROR: Build Failed. Aborting...
    Any ideas about what a full perl install should be ?
    Thanks in advance.
    Last edited by bangkok_manouel (2007-08-05 07:54:54)

    Thanks for your reply. Well you're right, few more infos won't hurt...
    I'm indeed using PKGBUILD from ABS. (no custom build)
    Arch : i686
    Dist : Testing (up2date)
    [eb@blackout ~]$ pacman -Qi perl
    Name : perl
    Version : 5.8.8-5
    URL : http://www.perl.org
    License : None
    Groups : None
    Provides : None
    Depends On : glibc coreutils gdbm db>=4.5
    Removes : None
    Required By : automake bogofilter groff inkscape lm_sensors perl-date-manip perl-error
    perl-extutils-depends perl-extutils-pkgconfig perl-gnome2-wnck perl-libintl-perl
    perl-locale-gettext perl-uri perl-xmms perlpanel perlxml procinfo vim
    Conflicts With : None
    Installed Size : 30503.13 K
    Packager : Tobias Powalowski <[email protected]>
    Architecture : i686
    Build Date : Mon Mar 12 18:29:03 2007 UTC
    Build Type : Unknown
    Install Date : Sat Aug 4 17:51:35 2007 UTC
    Install Reason : Installed as a dependency for another package
    Install Script : Yes
    Description : Practical Extraction and Report Language

  • Build Error: "VISA Configure Serial Port"

    Hi,
    I want to upgrade some old 6.i vi's to 8.5
    But on building the project  i am getting an Error:
    Please take a look in to the screenhots
    Greetings from the lake of Constance, Germany
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    MESSAGE.jpg ‏106 KB
    VI-LIB.jpg ‏783 KB

    Hi j_dodek, there is a function called "mass compile", did yoou already try this option?
    Please select Tools»Advanced»Mass Compile and choose the directory containing your old VI's. This will upgrade all the files in the directory or library.
    Please also have a look at the linked document that describes what the function mass compile does:
    http://digital.ni.com/public.nsf/websearch/654877E62A97B72986256C95006F9B24?OpenDocument

  • Can't communicate with MCU thru serial port

    Hi,
    now i am doing a project in which i use pc to transfer some data to
    MCU(PIC18F452)through rs232. I use labview 6.0 to do it.but i met some
    problems.

    Hi Liu,
    As I requested in your other question, please post a copy of the code you are using.
    The Enthusiast on this exchange are very good at solving problems provided we have a clear definition of what the "problem" is.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • I want to transfer data through the serial port in the same coding that hyperterminal uses. How can i do it?

    The serial port seems to be working, and labview seems to be sending the data, but the problem is in which format does it send the data, because in hyperterminal i just input the string "JDX" and it sends it to my device, with labview it sends something but my device does not recognize it.

    nobuto wrote:
    > I want to transfer data through the serial port in the same coding
    > that hyperterminal uses. How can i do it?
    >
    > The serial port seems to be working, and labview seems to be sending
    > the data, but the problem is in which format does it send the data,
    > because in hyperterminal i just input the string "JDX" and it sends it
    > to my device, with labview it sends something but my device does not
    > recognize it.
    Hyperterminal adds the carriage return/line feed to the string which is
    generated by the return key to send out the current line. LabVIEW simply
    sends out what you tell it, so try to set the string to "Show \ Display"
    format and add a \r or \n or \r\n to the command you want to send out.
    Assumes of course that you set the right baudr
    ate/bits/parity etc in
    LabVIEW with the VISA property node, when opening the serial port.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can't use ch340g serial port driver since upgrading to Yosemite on MacBook air

    I use my MacBook air with the Arduino 1.0.6 IDE. Since upgrading ( free upgrade) to Yosemite. I can no longer acess the ch340g serial port. (does not show up in arduino ide). I tried re-installing the driver. I get no errors and am told the install was successful. This was working very nicely before the upgrade. I now have three boards I cannot use. I am at a loss as to what I should do.  I suppose I could go back to Maverick but then I would have to go buy the operating system. This seems wrong to me. I was offered an upgrade that then leaves me up the creek without a paddle. Any help given would be highly appreciated.

    I have the same problem, a non stable CM341 serial to tty driver on Yosemity on a MacbookPro Retina.
    I followed the advice of Rsattaur, I executed the command: sudo nvram boot-args="kext-dev-mode=1"  and now I have big problems with my USB-ports.
    The result is a screen-of-death after connecting anything to my USB-ports!!!!
    Harold

  • 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 

  • How to access the serial port in Java?

    How can I initialise and access the serial port for writing and reading data from it? Are there any code examples available?

    I tried that and I tried compiling and executing one of its examples, the one below:
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class SimpleWrite {
    static Enumeration portList;
    static CommPortIdentifier portId;
    static String messageString = "Hello, world!\n";
    static SerialPort serialPort;
    static OutputStream outputStream;
    public static void main(String[] args) {
    portList = CommPortIdentifier.getPortIdentifiers();
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier) portList.nextElement();
    if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    if (portId.getName().equals("COM1")) {
    //if (portId.getName().equals("/dev/term/a")) {
    try {
    serialPort = (SerialPort)
    portId.open("SimpleWriteApp", 2000);
    } catch (PortInUseException e) {}
    try {
    outputStream = serialPort.getOutputStream();
    } catch (IOException e) {}
    try {
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch (UnsupportedCommOperationException e) {}
    try {
    outputStream.write(messageString.getBytes());
    } catch (IOException e) {}
    But when I execute this I get the error:
    Exception in thread "main" java.lang.NoClassDefFoundError: SimpleWrite
    What is wrong with this example??

  • Serial Ports using HyperV in Ubuntu guest OS

    I need to run a terminal session (term) from within the guest OS, Ubuntu 12.04.3 LTS to a serial port on the Windows 8.1P host. In my case a USB to serial adapter that Windows has mapped to COM5.
    I don't really know where to start.  In HyperV, under Settings, I see a Com1 and Com2 under hardware. The two options are None or Named pipe.  Not all that clear what to do here.
    Presumably this is what will be visible to Ubuntu as  /dev/ttyXX   ??
    Can anyone point the way to map a serial port into Ubuntu?   Or a suitable workaround?
    Thanks.

    "How can a VM be so cut off from the hardware like that?"
    Well, for the most part, it's been a long time since I have even seen a machine with a serial port on it.  It is so uncommon that one generally needs to buy an add-on card or do something like USB to serial.  That trend has been going on for a
    long time - that's why network based serial devices have tended to the solution for this.  This is nothing new.  Even Microsoft's Virtual Server, the precursor to Hyper-V (which was released five years ago) did not have access to serial ports.
    Since you are asking in the Hyper-V forum, the answer is you can't get to a physical serial port on your host.
    .:|:.:|:. tim

  • Serial port: Input/output signal errantly combined

    I am currently in the process of using LabView to replace another user interface for a scientific instrument.
    LabView is connected to this instrument through a serial port.  The instrument streams 25 bytes of binary data every second to the computer.  I can read the binary string (VISA Read) and save contiuously to disk using a while loop.  In addition, there are a few instructions I can send to the instrument that will do various functions (start logging, turn LEDs on/off, etc).  I can successfully send these instructions to the instrument using the previous interface, and in a stand-alone vi using VISA Write, but when I place the VISA Write function into the larger interface vi, signals go haywire.  Specifically, there are two separate LEDs that I can toggle with two different commands, but when in the larger interface vi, both commands toggle the same LED.  Also, it appears that the singal I send to the instrument (a single ASCII character) immediately bounces back to the computer into the 25 bytes of streaming binary data.  In other words, after I press the LED "on" key, one column of my streaming data changes when it is not supposed to (ex: after Binary to ASCII conversion, it changes from a single digit to a twenty digit value).
    Initially, I thought the problem was the sequence of VISA Read/Write.  In the current configuration, I read all data, then allow for Write commands.  Both the VISA functions are within the same While loop to continuously monitor the data.  Is it possible the Write signal output is not leaving the while loop and being read as input?  What would make the instrument read two different commands as the same one?  My goal is to run an interface that displays the streaming data as ASCII, and allows for a few different toggle options while the interface is running - is there are more efficient/elegant way than a while loop?
    ~Going Bananas
    Solved!
    Go to Solution.

    New replies now in gray.
    CodeMunkee wrote:
    1.  If you keep giving me good advice like this, I'll be tempted to change the background to Baltimore prison purple.
    I'll ignore this statement.
    2.  The buffer now lives outside the loop.  I understand clearly.  Part of the problem might be my instrument - when I cycle power the 19 digit number that was 'echoed' disappears.  Forget about that display stuff, it works properly - I accidentally removed the time delay when editing the vi.   But you do bring up an interesting point...
    Without the delay, the loop ran much faster.  If the bytes weren't at the port, the read statement would have returned nothing when it read zero bytes, thus blanking out the indicator rather quickly.
    Yes, Hexadecimal display shows 04 to indicate the end of the 25-byte data sample.
    Doing a bytes at port read is not always a good idea.  If not all the bytes had arrived yet when you ask for the read, you won't get all the data.  The remaining data being sent in that stream from the instrument will show up at the front of the buffer on the next read command. 
    While this isn't a common occurence, it does happen.  How can I prevent this from ever happening?
    Since you know each commands ends with a hex 04 (ASCII character for EOT), you could enable the termination character when you configure the serial port.  Set the termination character to be 4.  Then when you execute the VISA read, read a large number of bytes such as 25 or more.  The read will terminate at either the timeout, the requested number of bytes, or when the termination character is read.  With this setup, you could eliminate the wait statement and also not request the number of bytes as the port.  The VISA read will control the pacing of the loop.  Any extra bytes after the termination character are part of the next frame of data and will wait around until the next time you read the VISA port.
      3.  Implementing your ideas for the latch button works better.  I am still encountering issues with these commands however.  Attached is the new vi.  There are two commands I want to send, 't' turns on the LED light (they blink for 30 sec then time out), and the latch works perfectly for that, 'p' turns on the magnetometer light (an additional 'p' is required to turn it off), but I cannot get the command sent to the mag while the loop is running.  It turns on either at the beginning of the vi, or at the end of the vi (after Finish button is pressed).  This leads me to think the command 'p' is stuck inside the loop.  I tried adding another film strip (see attached vi) for the toggles to force the issue, but it didn't work. Additionally, the 'p' command effectively works as a 't' command, and the LED lights begin to blink when I press the 'p' button.  This isn't supposed to happen, and leads me to believe the 'p' command does in fact exit the loop but in the wrong manner.
    The "film strip" is another frame of a flat sequence structure.  It enforces the order of execution.  The next frame can't execute until everything in the prior frame has completed.  It isn't necessary in your case because the Error and VISA wires determine the order of execution with respect to the other VISA statements.  But it shouldn't hurt.
    There is no reason the "p" case structure should behave any differently than the "t" case structure.  Although you should wire the error wire through in the False case of the "p" structure like you did for the "t" structure.  There is no "exiting of the loop" in either case.  The loop runs until the stop button is pressed.  I would check the manual to see that t and p commands do what you think they should do.  Do they need a termination character of their own when they are sent?  Should they be upper case letters rather than lower case?  You can run NI Spy on your serial port and see the operations occurring with it and see the data coming in and what data is going out.  I would be suspicious that the device is not handling the command properly.
    Any ideas?  I think I've tried to put the toggle buttons outside the loop before, but then could only toggle once before the loop took over.  Ideally, these toggles would be available at any time while the data is streaming, so therefore inside the loop?
    The toggle buttons need to be within the loop so that they can be read on every iteration of the loop.  Outside the loop, as you discovered, they are only read once at the very beginning before the loop is started.
    4.  Thank you for the suggestion about the Selection Mode for the Open/Create File option.  It is annoying to create a file first.  I made the change, but I still get error messages when I use a file that does not yet exist.  LabView takes me to the first Open/Create/Replace vi when the error occurs.  Is there something else I must do?
    On the open file VI, there is an input that is Open as default when unwired.  Create a constant there and change to Replace or Create.
    Remember, if you have any questions about the way LabVIEW is handling something with serial ports, close the port within LabVIEW.  Open Hyperterminal and try the commands from there.
    Message Edited by Ravens Fan on 01-13-2009 03:55 PM

  • Reading CTS or DSR lines of Serial port

    Is there a way to read the status of CTS or DSR lines of a serial port?
    Also in what pins are these lines on standard PC?
    Ori Idan
    Helicon technologies LTD. National Instruments Alliance member in ISRAEL
    Email: [email protected]
    Home page: http://www.helicontech.co.il
    Tel: +972-6-6262353 Fax: +972-6-6262405
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Things should be made as simple as possible but not simpler
    Albert Einstein
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    On Thu, 04 May 2000 16:47:40 +0300, Ori Idan wrote:
    >Is there a way to read the status of CTS or DSR lines of a serial port?
    >Also in what pins are these lines on standard PC?
    While looking for info on printing I found the following:
    How can I control the DTR and RTS serial lines?
    Serial Port Init.vi can be used to configure the serial port for
    hardware handshaking; however, some applications may require manual
    toggling of the DTR and RTS lines. Because the interface to the
    serial ports is platform-dependent, each platform has a separate
    mechanism to control the lines.
    (Windows) The LavVIEW for Windows distribution contains a VI which you
    can use to drive the DTR and RTS serial lines. The VI serial line
    ctrl.vi, located in vi.lib\Instr\_sers
    up.llb, can be used to control
    these lines. The VI will toggle these lines according to the function
    input. Valid codes for the input are:
    0 noop
    1 clear DTR
    2 set DTR
    3 clear RTS
    4 set RTS
    5 set DTR protocol
    6 clr DTR protocol
    7 noop2
    (Macintosh) ..................
    (Sun).............................
    From LabVIEW User Manual page B-13
    Hope this helps.
    Regards,
    Steve Drake

  • Problem while reading data from Serial Port

    Hi All,
    I am facing some problem while reading data from Serial Port.
    As per the requirement I am writing the data on Serial Port and waiting for response of that data.
    Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
    When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
    So can anybody pls explain me how to overcome this problem?
    Regards,
    Neha

    My Problem is:-
    I am simoultaneouly wrting data on port & reading data from port.
    First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
    From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
    Can anybody help me to solve this issue.
    Neha.
    Code:
    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:
                        try
                             dataThread = Thread.currentThread();
                             dataThread.setPriority(10);
                             dataAvailable = true;
                                                                                    byte[] tempArray=new byte[availableBytes];
                                        inputStream.read(tempArray);
                                                                       catch (IOException io)
                             SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
    public void  writetoPort(byte[] data) throws IOException
                             outputStream.write(data);
                              while(finalTimeOut >= actualTime)
                            if( ! dataAvailable)
                                    actualTime = System.currentTimeMillis();
                           else
              synchronized (mainThread)
                   mainThread = Thread.currentThread();
                   mainThread.wait();
    public  void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
              obj.returnData(b);
              synchronized(mainThread)
                   mainThread.notify();
                                                           

Maybe you are looking for

  • How do I convert multiple pages into one for printing?

    I have a folder with a bunch of certificates, (different names) I would like to make into one file for printing.. how do I do that?

  • X and y co-ordinates - how to get rid of them??

    Hello When I click and hold to drag an object I keep getting a little box just under the arrow which details the x and y co-ordinates. How do I get rid of this? I can't figure out how to do it but I'm sure there must be a way! Thanks

  • Item Search

    Hi, I would like to know if an item can be searched by Manufacturer Part Number or Supplier Item Number from the Purchase Requisition and Purchase Order Forms. Currently we are able to search only by Item Code, Item Description & UOM. Thanks!

  • Identifying leaf node in a JTree

    I have a single selection JTree which was constructed using DefaultTreeModel. asksAllowsChildren is set to 'true' in the tree model. The nodes in the model are constructed using DefaultMutableTreeNode and each node is marked if it allows children or

  • NO_MERGE in outer query - please explain

    Hi, I'm studying paper about semijoins from www.dbspecialists.com . One of examples shows optimization via no_merge hint: SELECT   /*+ NO_MERGE (M) */                  DISTINCT M.name, M.code, M.description,                           M.item_id, M.ass