How to recognize Serial Port Device in Forms.

Hi All,
I am using Forms 6i. I want to know how to recognize a serial port device in forms. I have a requirement to recognize the reading of one serial port device into my form in my application and I have to store that reading value into database.
How can I acheive this?
Waiting for ur reply.
Thanks in Advance.
Gopinath Kona

hello,
i havent worked on Linux but have been extensively using it on windows.
did you try running any code ?
rohan

Similar Messages

  • How to Use Com ports on oracle forms

    Hai,
    how we can use com port to communicate to the device like Pole Display(output device) or fixed scaneer (input device) having serial port(Input device) in oracle forms.
    Thanks & regards

    For web forms you will probably need to create a PJC and/or use webutil and make calls to the device's API.

  • How to empty Serial port buffer ???

    Hi!
    I am having problems with serial port. I want to clear i
    serial ports buffer, but i dont know how to do this. I am receiving NMEA data through that port and every now and then i need to clear it because there are too much data and i dont need them all. Could someone please help me?

    Hi,
    Take a look at this link.
    http://www.sc-systems.com/JavaDoc/Serialio.SerOutputStream.html
    flush
    public void flush() throws IOException
    Causes any buffered data on the output stream to be written. Note: when using txDrain be advised that some OS's (like WinNT) do not provide a timeout on the OS level drain/flush call. In this case if handshake (flow control) is disabled from the far end your txDrain call will block until drain can complete. (i.e. until the handshake state changes). Because of this the default mechanism for flush is to watch the txBuffer. This will allow you to abort a stalled OutputStream since your code will not be locked up at the native level.
    Throws: IOException
    if an error occurs. Overrides:
    flush in class OutputStream
    However the above function and the class defining this is not provided by SUN.
    I hope this helped.
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • How to abort serial port VISA from wating.

    Hello All
    How can I abort serial port VISA while wating for a byte to arrive.
    Lets say I have timeout set for 3 min. but I want to cancel it before that , how to do it programatically?
    I tried to set timeout to 0 while wating for data, and it works, but I do not like this method.
    Thanks in advance
    Pawel

    Hi again
    I have made some investigations, and here is what I found:
    None of Serial Port Brake nor Set Time out work while the "VISA read" is active. All property node can access VISA class only when the "VISA read" is finished.
    Therefore, it looks like there is nothing I can do when VISA is active. The only solution is not to allow VISA read.vi to activate. I think I can use your idea and monitor the amount of bytes at the port.
    I wanted to avoid it.
    Thank you for your help
    Pawel

  • How to read serial port only when new data has been sent to it

    I've written this very simple vi to read the serial port whenever the MKS Helium Detector sends a new value.  The timing of new data is controlled directly from the front panel of the MKS instrument.  I thought it was as simple as looking at the "bytes at port", and reading the port only if the value is not zero.  The problem I'm having is that the read function is occuring whether I want it to or not.  Consequently, the "Scan from String" function is returning an error (0) once in a while, because it's reading the serial port as it's being updated (I think).   Apparently, when the port is in the process of being updated, it is not zero.   Anyway, I'm assuming there is a simple fix, but I'm having no luck finding the Easter egg.  Any help would be, as always, very much appreciated. 
    Attachments:
    MKSRead.vi ‏55 KB

    You can approach your problem in a couple of ways. The way you've got it written now, as soon as the number of bytes is non-zero, you read and convert. This means that when a partial string is there, you conversion is nor correct. One way is to wait until non-zero bytes like you do now, and then in another loop, read until the byte count is equal to zero and then do the conversion. You can also read until the cr\lf is detected and then do the conversion on the string. You can also enable the termination character for the read but then you'll have to increase the number of bytes to read to something other than just the number of bytes first available. If the instrument always returns the same number of bytes, you can use that as a constant for the VISA Read. Then the read will terminate whenever the byte count OR the termination character is detected.
    I modified your VI to show you how you might put it in a loop and what for the CR/LF to be detected. You would want to add a timeout to this so that if the character does not show up, the loop will not run infinitely
    Attachments:
    MKSRead_mod.vi ‏68 KB

  • How to read serial port and substring

    I am new for labview .I send data from microcontroller with C languange every 1 minute this codeprintf("T%3.2f,H%3.2f",fTemp_true,fRh_true);
    And I read data with Hyperterminal it show this T29.11,H67.88 I want to show 29.11 and 67.88 only and stroe in database. I study connect serial port in example and I have a question. If I use this code.Can I auto read every 1 minute or this code can read 1 time only and I have to click every 1 minute.How to auto read when I send data to serial port with microcontroller every 1 minute. And I cannot substring 29.11 and 67.88 because %3.2f can show T29.11,H67.88 or T129.11,H100 . and  How can I simple send data to database. Thank you . 

    No, you don't have to click run every minute. You just need to place a while loop around the VISA Read. You could use Wait (ms) but it would be better to use something like the Elapsed Time function and wire the time has elapsed output to a case statement with the VISA Read inside the true case.
    This is one way to parse the string:
    If you have the database connectivity toolkit, you can easily write to a database. There is also something called LabSQL.
    Message Edited by Dennis Knutson on 01-22-2010 01:42 PM
    Attachments:
    Parse String.png ‏16 KB

  • How to access serial port using servlet

    I want to communicate with a microcontroller connected to the serial port of my computer.
    *I am using the following:
    Windows 98 operating system
    Tomcat web server 4.1
    *The directory structure is as given:
    Tomcat 4.1/webapps/myjsp/web-inf/classes/remoteservlets.
    I have placed my jsp files in my jsp folder and classfiles in remote servlets folder.
    **my java program has compiled correctly.**
    ** my simple java application which accesses the serial port works fine.***
    *when I start tomcat I am able to access the sevlet as the servlet responds with the button name i have pressed.
    **** I have also tried the following
    Copied file comm.jar in <JAVA_HOME>\jre\lib\ext
    Copied file javax.comm.properties in <JAVA_HOME>\jre\lib
    Copied file win32com.dll in <JAVA_HOME>\lib and also in c:\windows\system32 and c:\windows\system
    ***************which helped me do away with errors.
    still I don't get any output. I dont get any errors either.
    PLEASE HELP. URGENT. i am at my wits end.
    Thank you.

    Servlet is the one which runs in the server side...if u want to comunicate with the serial port of the server in which ur servlet is running can be done but making use of Communication api available....
    U can download the Api from http://java.sun.com/products/javacomm/index.jsp
    There are three levels of classes in the Java communications API:
    High-level classes like CommPortIdentifier and CommPort manage access and ownership of communication ports.
    Low-level classes like SerialPort and ParallelPort provide an interface to physical communications ports. The current release of the Java communications API enables access to serial (RS-232) and parallel (IEEE 1284) ports.
    Driver-level classes provide an interface between the low-level classes and the underlying operating system. Driver-level classes are part of the implementation but not the Java communications API. They should not be used by application programmers.
    regards
    shanu

  • "how to read serial port using labview 6.0"

    sir i am doing a project and is in a need to extract data from serial port. can anyone help me

    This link, and the links from it, are a great place to start:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/8DECBF3E0B714BF3862568F9006E7851?opendocument
    2006 Ultimate LabVIEW G-eek.

  • How to detect serial port

    CommPortIdentifier portId;
              Enumeration en = CommPortIdentifier.getPortIdentifiers();
              Vector v=new Vector();
              while (en.hasMoreElements())
                   portId = (CommPortIdentifier) en.nextElement();
                   if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
                             v.addElement(portId.getName());
              }

    refer this URL
    http://www.java2s.com/Code/Java/Development-Class/ReadfromaSerialportnotifyingwhendataarrives.htm
         * Project                     :
         * Class                     : GUIFrame.java
         * Purpose                    :
         * Date_Created               :
         * @ Version 1.0
    import javax.swing.JFrame;
    // import javax.swing.JPanel;
    import javax.swing.JMenuItem;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import java.awt.event.*;
    import javax.comm.*;
    import java.awt.*;
    import javax.swing.*;
    // import javax.swing.border.TitledBorder;     
    public class GUIFrame extends JFrame implements ActionListener
         JButton connectPort;
         JComboBox combo;     
         //JButton baudRate;
         //JComboBox baudRateCombo;     
         public JTextArea textArea;     
         JButton sendData;
         public SerialConnection serialConnection;
         public GUIFrame()
              setLayout(null);
              setTitle("First Frame");
              serialConnection = new SerialConnection();                    
              setJMenuBar(createMenuBar());
              combo = new JComboBox();
              combo.setBounds(50, 50, 80, 25);
              listPort();
              combo.addActionListener(this);
              connectPort = new JButton("Connect");
              connectPort.setBounds(150, 50, 100, 25);
              connectPort.addActionListener(this);
              sendData = new JButton("Send Data");
              sendData.setBounds(150, 150, 100, 25);
              sendData.addActionListener(this);
              textArea = new JTextArea();
              textArea.setBounds(300, 300, 400, 300);
              textArea.setFont(new Font("sansserif",0,18));
              add(connectPort);
              add(combo);
              add(sendData);
              add(textArea);;
              setSize(400, 300);
              setVisible(true);
              addWindowListener(new MainWindowAdapter());
         public static void main(String arg[])
              System.out.println("Hi");
              new GUIFrame();
         public JMenuBar createMenuBar()
              JMenuBar menuBar = new JMenuBar();
              JMenu fileMenu = new JMenu("File");
              JMenuItem connectMenuItem = new JMenuItem("Connect");
              connectMenuItem.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae){
                        try{
                             if(serialConnection.portName == null){
                                  serialConnection.portName = combo.getSelectedItem().toString();
                             serialConnection.openConnection();
                        catch(Exception ex)
              JMenuItem disconnectMenuItem = new JMenuItem("Disconnect");
              disconnectMenuItem.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae){
                        try{
                             serialConnection.closeConnection();
                        catch(Exception ex)
              fileMenu.add(connectMenuItem);
              fileMenu.add(disconnectMenuItem);
              menuBar.add(fileMenu);
              return menuBar;
         public void listPort()
              CommPortIdentifier portId;          
              java.util.Enumeration enumeration = CommPortIdentifier.getPortIdentifiers();
              while(enumeration.hasMoreElements())
                   portId = (CommPortIdentifier)enumeration.nextElement();
                   if(portId.getPortType() == CommPortIdentifier.PORT_SERIAL)
                        if(!portId.isCurrentlyOwned())
                             combo.addItem(portId.getName());
         public void actionPerformed(ActionEvent ae)
              if(ae.getSource() == connectPort)
                   System.out.println("Connect is clicked");     
                   try
                        if(serialConnection.portName == null)
                             serialConnection.portName = combo.getSelectedItem().toString();
                        serialConnection.openConnection();
                   catch(Exception ex)
              if(ae.getSource() == combo)
                   System.out.print("Port Name = " + combo.getSelectedItem().toString());
                   serialConnection.portName = combo.getSelectedItem().toString();
              if(ae.getSource() == sendData)
                   byte b[] = new byte[5];
                   b[0] = (byte)0xaa;
                   b[1] = (byte)0xbb;
                   b[2] = (byte)0xcc;
                   b[3] = (byte)0xdd;
                   b[4] = (byte)0xee;     
                   try
                        serialConnection.getOutputStream().write(b);
                        display(b);
                   catch(Exception ex)
         public class MainWindowAdapter extends WindowAdapter
              public void windowClosing(WindowEvent win)
                   dispose();
                   System.exit(0);
         public void display(byte[] b)
              for(int i=0; i< b.length; i++)
                   textArea.append(Integer.toHexString (b[i] & 0xff) + " ");
              textArea.append("\n");
         * Project                     :
         * Class                     : SerialConnection.java
         * Purpose                    :
         * Date_Created               :
         * @ Version 1.0
    import javax.comm.*;
    import java.io.*;
    public class SerialConnection
         private OutputStream os;
         private InputStream is;
         private CommPortIdentifier portId;
         public SerialPort sPort;
         private boolean open;
         public String portName;
         SerialConnection serialConnection;
         public SerialConnection()
              serialConnection=this;
              PortHandler portHandler = new PortHandler(serialConnection);
              portHandler.init(serialConnection);
         public void setOutputStream(OutputStream os)
              this.os=os;
         public OutputStream getOutputStream()
              return os;
         public void setInputStream(InputStream is)
              this.is=is;
         public InputStream getInputStream()
              return is;
         * A Method to open the SerialConnection
    public void openConnection() throws Exception
              try
                   portId = CommPortIdentifier.getPortIdentifier(portName);
              catch (javax.comm.NoSuchPortException e)
                   System.out.println("noPort : "+e);
              try
                   sPort = (SerialPort)portId.open("port", 3000);               
                   open = true;
              catch (javax.comm.PortInUseException e)
                   throw new Exception();
              try
                   setOutputStream(sPort.getOutputStream());
                   setInputStream(sPort.getInputStream());               
                   System.out.println("IO stream is opened");
              catch (java.io.IOException e)
                   sPort.close();                    
         *A Method to Close the port and clean up associated elements.
         public void closeConnection()
              // If port is already closed just return.
              if (!open)
                   return;
              if (sPort != null)
                   try
                        this.os.close();
                        this.is.close();
                        System.out.println("IO stream is opened - CloseConnection");
                   catch (java.io.IOException e)
                        System.err.println(e);
                   sPort.close();
                   System.out.println("Port is closed");
              System.out.println("Flag Open - 1 : " + open );
              open = false;
              System.out.println("Flag Open - 2 : " + open);
         * Send a one second break signal.
         public void sendBreak()
              sPort.sendBreak(1000);
         * Reports the open status of the port.
         * @return true if port is open, false if port is closed.
         public boolean isOpen()
              return open;
         * A Method to add the event listener to the SerialPort
         public void addEventListener(java.util.EventListener listener)throws Exception
              System.out.println("Is not in opened state");
              if(isOpen())
                   System.out.println("Is in opened state");
                   try
                        sPort.addEventListener((javax.comm.SerialPortEventListener)listener);
                   catch (java.util.TooManyListenersException e)
                        sPort.close();               
                   // Set notifyOnDataAvailable to true to allow event driven input.
                   sPort.notifyOnDataAvailable(true);
                   // Set notifyOnBreakInterrup to allow event driven break handling.
                   sPort.notifyOnBreakInterrupt(true);
                   // Set receive timeout to allow breaking out of polling loop during
                   // input handling.
                   try
                   sPort.enableReceiveTimeout(50);
                   //sPort.enableReceiveTimeout(-1);
                   catch (javax.comm.UnsupportedCommOperationException e)
                        e.printStackTrace();
                   // Add ownership listener to allow ownership event handling.
                   portId.addPortOwnershipListener((javax.comm.CommPortOwnershipListener)listener);
         import javax.comm.*;
         public class PortHandler implements SerialPortEventListener,CommPortOwnershipListener{
              public SerialConnection serialConnection;
              public PortHandler(SerialConnection serialConnection)
                   this.serialConnection=serialConnection;
                   try{
                        serialConnection.addEventListener((SerialPortEventListener)this);
                        System.out.println("New Port Handler is called");
                   catch(Exception e)
                        System.out.println("Exception PortHandler(); " +e);
                        e.printStackTrace();
                   // Add this object as an event listener for the serial port.
                   System.out.println("PortHandler is initialised...");
              public SerialConnection getConnection(){
                   return serialConnection;
              public void setSerialConnection(SerialConnection serialConnection){
                   this.serialConnection = serialConnection;
              public void init(SerialConnection serialConnection){
                   setSerialConnection(serialConnection);
              public void serialEvent(SerialPortEvent e){
                   System.out.println("Event Initialised");
                   //Determine type of event.
                   switch (e.getEventType())
                        case SerialPortEvent.DATA_AVAILABLE:
                             try{
                                  readData();                              
                             catch(java.io.IOException e1)
                                  System.out.println("IO Excep "+e1.getMessage());
                                  e1.printStackTrace();
                             catch(Exception e1)
                                  System.out.println("Exception from Serial Event "+e1.getMessage());
                                  e1.printStackTrace();
                        break;
                        case SerialPortEvent.BI:
                        break;
              public void readData() throws java.io.IOException
                   byte b[]=new byte[8500];
                   int i=0,selectOption=0;
                   int newData=0;
                   int doubleLength=0;
                   int length=0;
                   // String mid="",strLen="";
                   while (newData != -1)
                        try     
                             System.out.println("getInputStream().available() : " + serialConnection.getInputStream().available());
                             newData = serialConnection.getInputStream().read();
                             System.out.println("newData\t"+newData);
                             if (newData == -1)
                                  System.out.println("\n End of the File\n");
                                  break;
                             if(i==0){
                                  b=(byte)newData;
                                  System.out.print("\n MSg ID \t= " + Integer.toString(newData&0xff,16)+"\n----------------------------");
                                  if(b[0] == (byte)0x00)
                                       i=-1;
                                       i++;
                                       continue;
                                  i++;
                                  //System.out.println("Method is called - selectOption : " + selectOption);
                                  continue;
                             if(i==1)
                                  b[i]=(byte)newData;
                                  System.out.print("\n Length =\t"+Integer.toString(newData&0xff,16)+"\n----------------------------");
                                  length=newData;
                                  if(length == 0)
                                       i=0;
                                       continue;
                                  i++;
                                  continue;
                             b[i]=(byte)newData;
                             if((b[0] == (byte)0x07) && (i == 2) || (b[0] == (byte)0xaf) && (i == 2) || (b[0] == (byte)0xec) && (i == 2)
                                  || (b[0] == (byte)0x5c) && (i == 2) || (b[0] == (byte)0xbe) && (i == 2) )
                                  String string = String.valueOf((byte)b[0]);
                                  String strLen = Integer.toString(b[2]&0xff,16) + Integer.toString(b[1]&0xff,16);
                                  System.out.println("\n\nLength String = " + strLen + "\n\n");
                                  java.math.BigInteger bi=new java.math.BigInteger(strLen,16);
                                  strLen = bi.toString();
                                  doubleLength = Integer.parseInt(strLen);
                                  System.out.println("\nLength int = " + doubleLength + "\n");
                                  //System.out.println("Method is called");
                             i++;
                             // Added by Siva on Jan 06
                             switch(selectOption)
                                  case 0:
                                       if(i>length+1)
                                            try
                                                 b[i]=(byte)newData;     
                                                 System.out.print("\nThe Last Byte =\t"+Integer.toString(newData&0xff,16)+"\n----------------------------");
                                                 System.out.print("\n"+i+" i Value =\t"+Integer.toString(newData&0xff,16));
                                                 System.out.println("\n----------------------- FINISHED------------------------------");
                                                 // service(b);     
                                                 System.out.println("\n----------------------- After Service------------------------------");
                                                 i=-1;
                                                 i++;               
                                                 continue;
                                            }catch (Exception e)
                                                 System.out.println("Exception in calling service 0:"+e.getMessage());
                                                 e.printStackTrace();
                                                 b[i]=(byte)newData;
                                       System.out.print("\nMSg ID \t= "+Integer.toString(newData&0xff,16)+"\n----------------------------");
                                       break;
                   }catch (java.io.IOException ex)     {
                        System.err.println("Abstarct Port handler Exception\t"+ex);
                   catch(Exception e1)
                        System.out.println("Exception from Read Data "+e1.getMessage());
                        e1.printStackTrace();
                   System.out.println("-----------------------------");
              public void ownershipChange(int type){
                   if (type == CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED){
              public void destroy()     
                   try{
                        serialConnection.closeConnection();     
                   }catch(Exception e){
                        System.out.println("Exception 2:"+e);     
                        e.printStackTrace();
              public void finalize(){
                   destroy();

  • How to remove serial port driver

    Hi,
    I am developing test driver for serial port. I can't able to remove existing driver (su) from solaris 8.
    I tried "rem_drv su" and rebooted system. system does not came up again and generates panic (core dump). Could anybody help me regarding this problem.
    Thanks in advance,
    -Mahantesh

    Instrument drivers are in the "LabVIEW\instr.lib" folder. Each driver should be in its own folder. To delete it, just delete the folder. You may need to update the palette menu to reflect the removal of the directory.
    Also, what do you mean by NI installing the driver? Are you referring to using the Help -> Find Instrument Driver? If so, what did you enter in the search criteria? Leybold isn't even in the list of manufacturers.

  • How to recognize s-series daq card in DAQmx Base 2.0

    I installed the "DAQmx BASE 2.0", and then installed 3 PCI DAQ boards.  It can recognize PCI-6024E and PCI-6713, but not PCI-6133.
    I followed exactly the same procedure as in the document called "How do I use NI-DAQmx Base with PCI/PXI Devices on Windows?"
    http://digital.ni.com/public.nsf/websearch/9C4E9FD0C7469BC286256F100074EADC?OpenDocument
    However, there is a web page (the link below) having labview example programs using DAQmx Base for "NI 6110 S Series Multifunction DAQ". So I think probably there is a way to recognize the S-series devices in DAQmx base.
    http://digital.ni.com/public.nsf/allkb/722DDAB4E914073D8625708100773677
    Does anybody know how to recognize S-series device in DAQmx Base 2.0?
    Thanks

    Alan,
    Thank you very much for the quick response.
    The reason I explored DAQmx: I want to do RLP and DAQmx Base has a simpler interface and more examples for RLP.
    The reason I want to go RLP instead of DAQmx is a long story.
    Summary of my applications:
    I need to read 4 input voltage (using PCI-6133) and then generate 12 voltages (using two PCI-6713 each has 8 outputs). Since the 12 generated voltages are related to the 4 input voltages, single sample /N channel AD/DA is required. The speed for the overall control loop has to be >100 kHz.
    Summary of my configurations:
    PIII, 700 MHz CPU, 512 MB RAM
    PCI-6133 and PCI 6713, LabVIEW 7.0, and DAQmx 8.0
    I also have PCI-6110 and PCI-6024E cards for comparison
    Summary for 4 channel single point acquisition (See the table below, AD only)
    1) The difference between P3/700MHz computer and P4/3GHz computer is very small
    2) The S-series performed worse than E- and M- Series
         Spec (kS/s)   Tested by me(700MHz P3)   by NI engineer (3GHz P4)
    6024E   200/4            15.7 kHz                    17.36 kHz
    6040E   250/4                                        18.9 kHz
    6251   1000/4                                        23.0 kHz
    6133   2500/1            13.8 kHz
    Summary for single channel single point acquisition (See the table below, AD only)
    1) The S-series performed much worse than E- and M- Series (simultaneous sampling is worse?)
         Spec (kS/s)    Tested by me (700MHz P3)
    6024E    200/1           54.8 kHz
    6110    5000/1           19.4 kHz
    6133    2500/1           14.5 kHz
    Simulated device          135 kHz
    Summary for single channel single point AO (See the table below, DA only)
    The spec of 6024E is only 10kS/s, but the loop can run at 132 kHz (the output from the port was not correct for sure). Using a simulated device (either 6024E or 6713), the loop rate is ~ 134 kHz (probably due to my low speed computer). This means the latency from 6024E devices is virtually zero. However, the latency from 6713 is way too much.
          Spec (kS/s)   tested by me (700MHz P3)
    6024E    10/1             132 kHz
    6713   1000/1              38 kHz
    Simulated device          134 kHz
    From all the above tests, it seems that s-series device (6133) and AO device (6713) perform much poorly in single point mode compared to E-series device (6024E).  I thought the difference might be due to the driver in DAQmx.  So, I want to try RLP to see whether I can gain up control loop speed to 100 kHz for my applications.
    Your suggestions and advices are appreciated.
    Thanks
    Jin-Xing

  • Crio serial port

    Hi
    Can anybody tell me how to access serial port of crio 9024. I have to transmit data on the serial port of the controller. This transmission must be through crio serial port and not through CSeries module.
    Thanks
    Solved!
    Go to Solution.

    Hello Rajeev,
    This is an old post, and I almost missed the reply, but I'll see if I can help.
    As you have experience with Hyperterminal, have you plugged the serial port of the cRIO into hyperterminal, and see if anything is actually be transmitted?
    Does the LCD have a microcontroller that interprets the serial commands?
    If so, do these commands have to have an explicity baud rate or termination character?
    Consider looking at this example as a guide for troubleshooting:
    Serial Data Transfer Between cRIO and Host
    In the future, consider making a new post, and just linking an old post.  Hopefully, someone can reply to you much sooner.
    Regards,
    George T.
    Applications Engineering Specialist
    National Instruments UK and Ireland

  • Java & Serial Port

    Hello,
    I downloaded the Java SDK 1.3.1 and the docs today. I would like to write a small app that will talk to a serial port device and just receive the responses from it (much like a keypad). I'm not sure though if I need more then the SDK 1.3.1 or not. I see a "Communications API" that is avaliable but I'm not sure that I need this (dated 1998) or if it's included in the SDK that I downloaded. I checked the documentation but couldn't find anything.

    JustLee,
    Thanks! I checked it out and downloaded it but can't seem to get the sample applications to run. I keep getting an error stating "noclassdeffounderror" when I try to run them. I guess I must have really messed something up becaues now when I just run my basic "Hello World" application I get the same error message.
    Guess I'll keep toying with it.

  • COMMAPI freeing serial port

    I have a question about Java commapi and serial ports. In my application I call close on a SerialPort object and associated input/outputstreams. Later on I try to open the port again by calling open on a CommPortIdentifier object and I get a RuntimeException with message "Device busy". If I close the application and start it again, the serial port is opened without problems. My question is should I do something more when closing the port to free it?
    Code that tries to close the port:
    inStream.close(); //inputstream
    outStream.close(); //outputstream
    inStream=null;
    outStream=null;
    port.close(); //SerialPort
    port.removeEventListener();
    port=null;My platform is Sparc Solaris 10.
    Thanking you in advance,
    Anguinus

    I know this is a very old post, but google came up with it after searching for ttyUSB0 and java, so I thought I'd chip in the solution so that other people arriving here might benefit :)
    The trick is to go into javax.comm.properties and add the ttyUSB0 to the list of serial ports:
    # Implementation specific driver
    driver=com.sun.comm.LinuxDriver
    # Paths to server-side serial port devices
    serpath0 = /dev/ttyS0
    serpath1 = /dev/ttyS1
    serpath2 = /dev/ttyUSB0               # <--- added ttyUSB0
    # Paths to server-side parallel port devices
    parpath0 = /dev/parport0
    parpath1 = /dev/parport1Works fine for me

  • How to configure visa to adquire dat from serial port and then converted to numeric value from a home embedded device

    I already stablish communication with my serial port using VISA, selecting COM1 as the resoure name.
    After that, I tried to read the data from the port (as we know the data was in string format )but I need to convert the data to numeric value to hadle it (no arrays).
    Another main thing is that I'm develoing a new based Embedded design and tthe info that will trhow out from the device to the PC is binary.
    How can I solved the problem, and if I want to make bidirectional communication with my system how can I do it? The VISA intructions as *IDN? and so forthetc can be recognize by the external system if the COM1 port is recognized by NI Max as ADSRL1::I
    NSTR1?

    Hello,
    For an example of bidirectional serial communication in LabVIEW, please see the shipping example LabVIEW <-> Serial.vi. This can be found from LabVIEW by going to Help >> Find Examples. From the example finder, select Hardware Input and Output >> Serial >> LabVIEW <-> Serial.vi.
    Once you are able to read the string data in, you can use the VIs in the String/Number Conversion palette to convert the data to numeric format. To access these, right-click on the block diagram >> All Functions >> String >> String/Number Conversion.
    Let me know if this does not help.
    Regards,
    Sean C.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • Scanned doc will not print entire page

    I have a scanned document in Acrobat 7 using File -> Create pdf from scanner. Scanned at 400 dpi color. The document is a printed table with a few handwwritten redlines on it. In Acrobat, it has 4 "images". One is the entire document and three are th

  • Reference Operation Set association to a Routing by CP_BD_DIRECT_INPUT_PLAN

    Hi . I want to know how we can associate reference Operation Set to a  Routing  with  using the FM: CP_BD_DIRECT_INPUT_PLAN (The Direct Input API for Routing update) . I am successful with creation of Operations(Table: PLPO_DI_TAB). I found few field

  • Switching sim cards from different carriers while activating the phone

    I got an iPhone 5 from a friend and am trying to switch it to my number. She had AT&T and I obviously have Verizon. Even though I have a Verizon sim card, it wont let me activate the phone with the correct Sim card. Help?

  • Fetch the SAP Status Bar Message?

    Hi Experts, Pls. let me know that, How to pull/fetch the data (e.g.#) from SAP Status bar message, issued by SAP, while any creation takes place? e.g. When some thing (MB01) is created, SAP alert u with a Message, (like, saying that ''1234567890'' Do

  • Script error for desktop manager...

    everytime i go to install version 4.3 for my pearl it runs into a script error and the installation fails... does anyone know what this means??? thx for your help