Serial Communication In JAVA

Hi.
I just wanted to know if serial communication is possible using java. If yes, which are the classes used.
Thank you.

I have found javax.comm for Linux and Solaris but not for Windows can any body help me about it .
How can I comunicate using rs232 two computers using Java in Windows.
Tkns
I

Similar Messages

  • RE:Serial communication using java

    Hello,
    First of all, I want to make clear thatI did not double post it as previously I posted it in Networking section..But I was told that I have not posted it at appropirate place....thats wht I am posting here.
    I am a newbie in Java.I have started with Netbeans.I have designed a interface using Netbeans.It has 5 texboxes and two buttons named "Start" and "Stop".
    I want to receive data from the serial port and display the data in text boxes.I want when I press Start button, then it should start listening to the serial port .If adat is present on serial port, then it must receive it and displayin the text boxes.when I press Stop button, then it should stop receiving data as well close connection.
    can please anyone help me on this?
    I would be highly thankful for this.
    Regards,
    Jass

    Hello All,
    I am using the javax.comm for serial communication using serial to usb converter at port COM4(I check using device manager.).Beside that I have also added the option in the programming to look into other COMs also.I have placed "comm.jar " and "javax.properties" into jdk\lib\ext and "win32.dll" into jdk\bin.
    But I am getting the following output:
    Wed Dec 24 02:23:43 EST 2008: COM4 null
    Serial port List is  javax.comm.CommPortEnumerator@1a46e30
    Serial port ID  is null
    BUILD SUCCESSFUL (total time: 0 seconds)
    The code Is as follows:
    import java.io.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.comm.*;
    import java.util.*;
    public class serialport implements Runnable, SerialPortEventListener
        static CommPortIdentifier portId, portId1;
        public SerialPort serialPort;
        public OutputStream outputStream;
        public InputStream inputStream;
        Thread readThread;
        static Enumeration portList;
         static String TimeStamp;
        public static void main(String args[])     
        {try {
              portId1 = CommPortIdentifier.getPortIdentifier("COM4");
              }catch(Exception e) {
          TimeStamp = new java.util.Date().toString();
          System.out.println(TimeStamp + ": COM4 " + portId1);}
               portList = CommPortIdentifier.getPortIdentifiers();
               System.out.println("Serial port List is  "+portList+"\n");
               portId = (CommPortIdentifier) portList.nextElement();
              System.out.println("Serial port ID  is "+portId+"\n");
           while (portList.hasMoreElements()) {
              portId = (CommPortIdentifier) portList.nextElement();
              if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
                if (portId.getName().equals("COM3")) {
                     System.out.println("Serial port COM3 is found\n");
                serialport Port = new serialport();
                else if (portId.getName().equals("COM4")) {
                     System.out.println("Serial port COM4 is found\n");
                serialport Port = new serialport();
                else if (portId.getName().equals("COM6")) {
                     System.out.println("Serial port COM6 is found\n");
                serialport Port = new serialport();
                else if (portId.getName().equals("COM7")) {
                     System.out.println("Serial port COM7 is found\n");
                serialport Port = new serialport();
                else if (portId.getName().equals("COM5")) {
                     System.out.println("Serial port COM8 is found\n");
                serialport Port = new serialport();
      public serialport()
        try {
          serialPort = (SerialPort) portId.open("MainClassApp", 2000);
        } catch (PortInUseException e) {
                  System.out.println("Port is owned by another application \nor port cannot be opened\n");
        try {
          inputStream = serialPort.getInputStream();
        } catch (IOException e) {
             System.out.println("IOstream for port is not available\n");}
        try {
          serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
        } catch (UnsupportedCommOperationException e) {
             System.out.println("Serial port is not properly configured\n");}
        try {
          serialPort.addEventListener(this);
        } catch (TooManyListenersException e) {
             e.printStackTrace();}
        serialPort.notifyOnDataAvailable(true);
        readThread = new Thread(this);
        readThread.start();
        public void run() {
           try {
             Thread.sleep(2000);
               } catch (InterruptedException e) {      e.printStackTrace();}
        public void serialEvent(SerialPortEvent event) {
             Runtime rt = Runtime.getRuntime() ;
             Process p;
        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[1];
          try {
            while (inputStream.available() > 0)
                   int numBytes = inputStream.read(readBuffer);
                   System.out.print(new String(readBuffer));
                    break;
            System.out.print(new String(readBuffer));
                } catch (Exception e) {
               e.printStackTrace();}
          break;}  }  }Kindly help........I really wanna to know where is the error???
    Thanks
    Edited by: jass11 on Dec 23, 2008 11:39 PM
    Edited by: jass11 on Dec 23, 2008 11:51 PM

  • 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

  • Java Serial Communication (Student)

    Hey there,
    Im new to this forum and currently a full time student (not in any type of computer programming). I am currently working on an assignment in Java Programming and I am having difficulty with having my program executing the scenario i want.
    If anyone is willing or available to help me, I will post the code I currently have and explain where I am encountering problems.
    The program is a basic serial communication applet, that has two buttons and a textfield. The first button is supposed to send the text in the textfield (writeButton) and the second button will be used to read the text (readButton).
    For now I am creating two separate applets, one to write and one to read, with only one button "performing" an action in each.
    Thanks

    Ok I got rid of the code that I don't think I need and added the actionListener.
    The program compiles with no errors, but will still not send the messageString.
    Do you see where the possible errors are?
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    import javax.swing.JApplet;
    import java.awt.event.*;
    import java.awt.Graphics;
    import java.applet.*;
    import java.awt.*;
    public class ProjectWrite_test_2 extends JApplet implements ActionListener
         static Enumeration portList;
         static CommPortIdentifier portId;
         static String messageString = "Hello, world!\n";
         static SerialPort serialPort;
         static OutputStream outputStream;
         //public static void main (String [ ] args) {
         String OutString;
         TextField textFieldWrite;
         Button writeButton;
         Button readButton;
              public void init()
                    writeButton = new Button ("Press to Write");
                    writeButton.addActionListener(this);
                    readButton = new Button ("Press to Read");
                   Container window = getContentPane();
                   window.setLayout(new FlowLayout());
                   window.add(writeButton);
                   window.add(readButton);
                    textFieldWrite = new TextField(50);
                   add(textFieldWrite);
                    String outString = textFieldWrite.getText();
                   public void paint (Graphics g)
                             String s = textFieldWrite.getText();
                   g.drawString(s, 40, 50);
              public void actionPerformed(ActionEvent c)
                        portList = CommPortIdentifier.getPortIdentifiers ( ) ;
                                  while (portList.hasMoreElements ( ) ) {
                                       portId = (CommPortIdentifier) portList.nextElement ( ) ;
                                       if (portId.getPortType ( ) == CommPortIdentifier.PORT_SERIAL) {
                                            if (portId.getName ( ) .equals ("COM1")) {
                                                      try {
                                                           serialPort = (SerialPort)
                                                           portId.open ("SimpleWrite", 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) { };
                             }

  • How to make Serial Communication in windows

    Hello, I want to do serial communication using windows platform.Sun provides javax.comm package for solaris & unix but there is no any provision for windows platform.Can I use it in Windows Platform.?

    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=698876

  • Serial communication in j2me

    hi,
    is serial communication via an rs232 port is possible in j2me to be used in micro devices?
    thanx

    Check the search engine top right
    http://forum.java.sun.com/thread.jsp?forum=31&thread=50052

  • Applet- RS232 serial communication

    Hi,
    Can any one tell how to do applet -RS232 serial communication?Do i signed applets? any secuirty policies to incorporated?
    Thanx
    /JP

    you need to install the jre, and place the win32.dll at JavaSoft\JRE\1.3.1_06\bin, that properties file place at JavaSoft\JRE\1.3.1_06\lib, comm.jar at JavaSoft\JRE\1.3.1_06\lib\ext\
    and in ur code try to use it to open ur com port
    public String test() {
    String drivername = "com.sun.comm.Win32Driver";
    try
    CommDriver driver = (CommDriver) Class.forName(drivername).newInstance(); driver.initialize();
    catch (Throwable th)
    {* Discard it */}
    drivername = "javax.comm.*";
    try
    CommDriver driver = (CommDriver) Class.forName(drivername).newInstance(); driver.initialize();
    catch (Throwable th)
    {* Discard it */}
    portList = CommPortIdentifier.getPortIdentifiers();
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier) portList.nextElement();
    if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    if (portId.getName().equals("COM2")) {
    //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) {}
    int i=0;
    while(true)
    try {
    messageString="hi";
    System.out.println(i++);
    outputStream.write(messageString.getBytes());
    } catch (IOException e)
    System.out.println(e);
    messageString=String.valueOf(e);
    return messageString;
    and yet u need to signed the applet
    1. Compile the applet
    2. Create a JAR file
    3. Generate Keys
    4. Sign the JAR file
    5. Export the Public Key Certificate
    6. Import the Certificate as a Trusted Certificate
    7. Create the policy file
    8. Run the applet
    Susan
    Susan bundles the applet executable in a JAR file, signs the JAR file, and exports the public key certificate.
    1. Compile the Applet
    In her working directory, Susan uses the javac command to compile the SignedAppletDemo.java class. The output from the javac command is the SignedAppletDemo.class.
    javac SignedAppletDemo.java
    2. Make a JAR File
    Susan then makes the compiled SignedAppletDemo.class file into a JAR file. The -cvf option to the jar command creates a new archive (c), using verbose mode (v), and specifies the archive file name (f). The archive file name is SignedApplet.jar.
    jar cvf SignedApplet.jar SignedAppletDemo.class
    3. Generate Keys
    Susan creates a keystore database named susanstore that has an entry for a newly generated public and private key pair with the public key in a certificate. A JAR file is signed with the private key of the creator of the JAR file and the signature is verified by the recipient of the JAR file with the public key in the pair. The certificate is a statement from the owner of the private key that the public key in the pair has a particular value so the person using the public key can be assured the public key is authentic. Public and private keys must already exist in the keystore database before jarsigner can be used to sign or verify the signature on a JAR file.
    In her working directory, Susan creates a keystore database and generates the keys:
    keytool -genkey -alias signFiles -keystore susanstore -keypass kpi135 -dname "cn=jones" -storepass ab987c
    This keytool -genkey command invocation generates a key pair that is identified by the alias signFiles. Subsequent keytool command invocations use this alias and the key password (-keypass kpi135) to access the private key in the generated pair.
    The generated key pair is stored in a keystore database called susanstore (-keystore susanstore) in the current directory, and accessed with the susanstore password (-storepass ab987c).
    The -dname "cn=jones" option specifies an X.500 Distinguished Name with a commonName (cn) value. X.500 Distinguished Names identify entities for X.509 certificates.
    You can view all keytool options and parameters by typing:
    keytool -help
    4. Sign the JAR File
    JAR Signer is a command line tool for signing and verifying the signature on JAR files. In her working directory, Susan uses jarsigner to make a signed copy of the SignedApplet.jar file.
    jarsigner -keystore susanstore -storepass ab987c -keypass kpi135 -signedjar SSignedApplet.jar SignedApplet.jar signFiles
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5. Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    The -storepass ab987c and -keystore susanstore options specify the keystore database and password where the private key for signing the JAR file is stored. The -keypass kpi135 option is the password to the private key, SSignedApplet.jar is the name of the signed JAR file, and signFiles is the alias to the private key. jarsigner extracts the certificate from the keystore whose entry is signFiles and attaches it to the generated signature of the signed JAR file.
    5: Export the Public Key Certificate
    The public key certificate is sent with the JAR file to the whoever is going to use the applet. That person uses the certificate to authenticate the signature on the JAR file. To send a certificate, you have to first export it.
    In her working directory, Susan uses keytool to copy the certificate from susanstore to a file named SusanJones.cer as follows:
    keytool -export -keystore susanstore -storepass ab987c -alias signFiles -file SusanJones.cer
    Ray
    Ray receives the JAR file from Susan, imports the certificate, creates a policy file granting the applet access, and runs the applet.
    6. Import Certificate as a Trusted Certificate
    Ray has received SSignedApplet.jar and SusanJones.cer from Susan. He puts them in his home directory. Ray must now create a keystore database (raystore) and import the certificate into it. Ray uses keytool in his home directory /home/ray to import the certificate:
    keytool -import -alias susan -file SusanJones.cer -keystore raystore -storepass abcdefgh
    7. Create the Policy File
    The policy file grants the SSignedApplet.jar file signed by the alias susan permission to create newfile (and no other file) in the user's home directory.
    Ray creates the policy file in his home directory using either policytool or an ASCII editor.
    keystore "/home/ray/raystore";
    // A sample policy file that lets a JavaTM program
    // create newfile in user's home directory
    // Satya N Dodda
    grant SignedBy "susan"
    permission java.security.AllPermission;
    8. Run the Applet in Applet Viewer
    Applet Viewer connects to the HTML documents and resources specified in the call to appletviewer, and displays the applet in its own window. To run the example, Ray copies the signed JAR file and HTML file to /home/aURL/public_html and invokes Applet viewer from his home directory as follows:
    Html code :
    </body>
    </html>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    width="600" height="400" align="middle"
    codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,1,2">
    <PARAM NAME="code" VALUE="SignedAppletDemo.class">
    <PARAM NAME="archive" VALUE="SSignedApplet.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
    </OBJECT>
    </body>
    </html>
    appletviewer -J-Djava.security.policy=Write.jp
    http://aURL.com/SignedApplet.html
    Note: Type everything on one line and put a space after Write.jp
    The -J-Djava.security.policy=Write.jp option tells Applet Viewer to run the applet referenced in the SignedApplet.html file with the Write.jp policy file.
    Note: The Policy file can be stored on a server and specified in the appletviewer invocation as a URL.
    9. Run the Applet in Browser
    Download JRE 1.3 from Javasoft
    good luck! [email protected]
    i already give u many tips, i use 2 weeks to try this to success, hopw that u understand that, a result of success is not important, the process of how to get things done is most usefull!

  • GPIB, Serial Communication.

    Does JAVA support GPIB or Serial Communication?

    check this out for a Java wrapper for GPIB Comms
    http://cs.ulb.ac.be/projects/jpib
    Regards Flacky

  • Sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loop

    sir i have given lot of effort but i am not able to solve my problem either with notifiers or with occurence fn,probably i do not know how to use these synchronisation tools.

    sir i am using datasocket read ,i am communicating with java but my problem is that bcz im using while loop to see if value has changed my labview consumes all the processors time ,sir i want a event like thing so that while loop is not in continuous loopHi Sam,
    I want to pass along a couple of tips that will get you more and better response on this list.
    1) There is an un-written rule that says more "stars" is better than just one star. Giving a one star rating will probably eliminate that responder from individuals that are willing to anser your question.
    2) If someone gives you an answer that meets your needs, reply to that answer and say that it worked.
    3) If someone suggests that you look at an example, DO IT! LV comes with a wonderful set of examples that demonstate almost all of the core functionality of LV. Familiarity with all of the LV examples will get you through about 80% of the Certified LabVIEW Developer exam.
    4) If you have a question first search the examples for something tha
    t may help you. If you can not find an example that is exactly what you want, find one that is close and post a question along the lines of "I want to do something similar to example X, how can I modify it to do Y".
    5) Some of the greatest LabVIEW minds offer there services and advice for free on this exchange. If you treat them good, they can get you through almost every challenge that can be encountered in LV.
    6) If English is not your native language, post your question in the language you favor. There is probably someone around that can help. "We're big, we're bad, we're international!"
    Trying to help,
    Welcome to the forum!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • 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

  • 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.

  • VISA Read function Read buffer problem in serial communication

    Hi,  I use VISA write and read function in serial communication app, the device continuously sends 0x00 if it is not receive a request from Labview program running on PC.
    And the request sent by labview is programmable. I met a weird problem, each time the request changes, the VISA read buffer output port still shows the last request firstly, from second time, shows the right request.
    It works like: Req code: ... 50, 51,51,51,50....;  VISA Read buffer: ...50, 50, 51, 51, 51, 51, 50....
    Please refer to the program.
    Attachments:
    readOne_test.vi ‏21 KB

    How are you running this?  You don't have a while loop around it.  Is it part of a larger VI?  Please don't tell me you are using the run continuously button.
    You don't have any wait statement between you VISA Write and your bytes at port.  So it is very likely the receive buffer is still empty since you didn't give your VI time to wait for the device to turn around and give a reply.  If you read 0 bytes, your VISA read string will be empty.  How does your decoder subVI (which you didn't include) handle an empty string?

  • To read 512 bytes using serial communication

    I want to read 512 bytes of data using rs 232 with the timeout of 30ms. I am using "Serial read with timeout -Palm.vi". Is there a limitation of the number of bytes I can specify to this VI?
    Thanks!!
    Attachments:
    Serial_Read_with_Timeout--Palm.vi ‏63 KB

    Hi software enigineer,
    It is not possible to transfer 512 bytes per 30 ms here. To do this would require a baud rate of 136533 (512*8/.03) and the maximum possible baud rate is 115000. The recommend baud rate for a serial transfer is 9600, which would mean transferring at most 36 bytes if the timeout is kept at 30ms. Moreover, there is usually some overhead involved in serial communication, and I would recommend sending a little less than the maximum 36 bytes every time too.
    On another note, I noticed that in your block diagram, you are using the Bytes at Serial Port vi. Definitely use the output of this vi to determine how many bytes to read at a time and read the bytes as they become available in the serial buffer rather than reading in a large buffer
    all at once. Continuously read and append the output until there are no more bytes to be read or until the termination character is read. This will avoid any lost data transmission due to overflow.
    Good luck with your program!
    Kileen Cheng
    Applications Engineer
    National Instruments

  • User-specified DAQ interruptions, instrument control through serial communication

    I'm working on an instrument control program, and I've run into a structural problem that I cannot figure out.
    The instrument in question is effectively a thermostat.
    The program has two functions:
    1.)  Background sampling to record temperature in a log over time.
    2.)  Adjust temperature according to user input
    The issue is that the instrument uses EIA-232 serial communication to talk to the PC.
    This prohibits simultaneous execution.  Attempting to send a command while the program is taking a sample will result in serial blockage errors.
    So the program must interrupt background sampling until the specified command has been completed.
    I can't figure out how to do this.
    My best idea was to create a manual pause control.  If the user wants to adjust the temperature, he hits a switch to pause the sampling, sends the appropriate command, then hits the switch again to reinitiate sampling.  This method will suffice, but is not ideal.
    Beyond that, I really have no idea how to prevent the two functions from running into each other.
    Help structuring this program would be greatly appreciated,
    Thank you

    Look into Semaphores (icons with traffic light glyphs)
    Set up a Semaphore resource to the COM port that is wired to two parallel structures.
    One structure would do the background polling, the other would handle setting changes.
    Prior to background poll, lock the resource, then unlock it after the poll. Likewise for the setting change command.
    When a resource is locked, the other process cannot access it until it is unlocked. Be sure to dispose of the Semaphore when ending the program.
    -AK2DM
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Attachments:
    SempahoreExample.jpg ‏256 KB

Maybe you are looking for

  • Fixed Asset Importation Issue (Capitalisation Date)

    Hello experts, I have an issue regarding fixed asset importation. I've import the fixed asset master data correctly in the system, with it's correct capitalisation date, APC, depreciation cumulative value and everything else correctly in the master d

  • Question about Alert Framework in Solution Manager

    Hi all, We are planning to use Solution Manager as Central Monitoring Server, so I want to know what the advantage to use Solution Manager is, especially in Alerting. We can define auto-reaction methods for monitors to send CCMS alerts to Alert Frame

  • I need to upgrade DDR RAM on my Satellite A30

    Hi! i need to upgrade my ddr upto 1GB or 2GB, how can i identify which ram i can buy. blow is detail of my laptop. Satellite A30-514 P4 2.8GHz/WX... Key Features - Intel® Pentium® 4 2.8GHz Processor - Microsoft® Windows® XP Home Edition - 512MB DDR R

  • Error Opening Adobe PDF created with Xcelsius 2008

    I am using an SAP Product - Xcelsius 2008 to create a dashboard that I exported to PDF.  The document essentially contains a Flash SWF file embedded in the PDF.  I can open it up fine with my Adobe Acrobat 9 Pro.  Some of my colleagues can open it up

  • Itunes keeps saying it has stopped working when on internet or in itunes

    When I open itunes store and sometimes itunes when connected to the internet it comes up with " i tunes has stopped working" A problem caused the program to stop working correctly. Windows will.... Then the only thing you can do is click - close prog