Comm ports in win 8.1

i need to know what comm port to set up my psk31 to transmit to my ft897d hf radio 
i cannot find how to get to the proper area to set it up  in win 8.1 
i cannot transmit without the port setup

i need to know what comm port to set up my psk31 to transmit to my ft897d hf radio 
i cannot find how to get to the proper area to set it up  in win 8.1 
i cannot transmit without the port setup

Similar Messages

  • Select serial comm port in sub vi during run-time

    Hi, would like to be able to select the comm port (serial RS232) in sub vi to use in main vi during run time. How can I do this? Have tried and failed, for on startup an error occurs because I have not selected a port yet. An example would be invaluable! Thanks alot, Madri

    Hi Madri !
    What you could do is to intercept the com errors, and open a configuration vi either if there is an init error or if the user has pressed a "Change port" boollean (or menu...). Do not forget to close the previously opened serial port, and to open/init the new one. I have attached a small example of this idea.
    Of course com errors can have various origins, and do not require always to change the serial port. So, you have some additional work to do.
    Hope this helps
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Select_port.vi.zip ‏12 KB
    Com_with_serial_init_vi.vi.zip ‏13 KB

  • Attach Forms With Comm Port in Oracle Forms

    I am trying to make connection of Oracle forms Builder with my device using comm port but i dnt know the complete procedure to attach the comm with oracle forms also i have no idea to convert asquii data to normal form.Please any one help me to attach comm port with my oracle forms and also convert asqui code which is showing on hyper terminal into normal data.Also I am using oracle forms 6i

    Make a java component (PJC) and use a rxtx library (http://rxtx.qbang.org/wiki/index.php/Examples) ...
    I have made a PJC to use a RS232 port from oracle forms for Hypercom POS terminal..
    Here is my code (in short i will post a component on PJC site (here I can't post a complete code because of 30000 char limit ;) )..
    If you look in method "public void init(IHandler handler) " I make a download of rxtxSerial.dll from my forms server and then I call System.loadLibrary("rxtxSerial");"
    In other way you must put the dll in windows/system32 path.. This dll is native library for rs232 communication.
    If you look at the method "public void doTransaction" you can see the initialization of comm port...
    With inputStream and OutputStream you read and write datas to/from your rs232 port..
    p.s: the code is not complete but you can see how I made the rs232 communication (also the code is not final ;) )
    ====================================================
    public class PosTerminalPjc extends VBean {
         private static final long serialVersionUID = -8814623494538014849L;
         Properties res = new Properties();
         SerialPort serialPort;
         OutputStream os;
         InputStream is;
         CommPortIdentifier portId;
         Enumeration portList;
         IHandler mHandler;
      Random randomGenerator = new Random();
            char STX = 2;
         char ETX = 3;
         char EOT = 4;
         char ACK = 6;
         char NAK = 15;
         char FS = 28;
         private static final ID COMPORT         = ID.registerProperty("COMPORT"); // serial port (COM1,COM2,COM3,...)
         private static final ID AMOUNT          = ID.registerProperty("AMOUNT"); // amount of the transaction (12)
         private static final ID TRANSACTIONTYPE = ID.registerProperty("TRANSACTIONTYPE"); // SALE, REFUND
      private static final ID EXECUTE         = ID.registerProperty("EXECUTE"); // invoke doTransaction();
      //Output parameters to form
      private static final ID TRANSACTIONPROCESSED  = ID.registerProperty("TRANSACTIONPROCESSED");
      private static final ID TRANSACTIONFLAG       = ID.registerProperty("TRANSACTIONFLAG");
      private static final ID TRANSACTIONNUMBER     = ID.registerProperty("TRANSACTIONNUMBER");
      private static final ID BATCHNUMBER           = ID.registerProperty("BATCHNUMBER");
      private static final ID TRANSACTIONDATE       = ID.registerProperty("TRANSACTIONDATE");
      private static final ID TRANSACTIONTIME       = ID.registerProperty("TRANSACTIONTIME");
      private static final ID TRANSACTIONAMOUNT     = ID.registerProperty("TRANSACTIONAMOUNT");
      private static final ID CARDDATASOURCE        = ID.registerProperty("CARDDATASOURCE");
      private static final ID NUMBERCUSTOMERCARD    = ID.registerProperty("NUMBERCUSTOMERCARD");
      private static final ID EXPIRATIONDATE        = ID.registerProperty("EXPIRATIONDATE");
      private static final ID TERMINALID            = ID.registerProperty("TERMINALID");
      private static final ID MERCHANTID            = ID.registerProperty("MERCHANTID");
      private static final ID COMPANYNAME           = ID.registerProperty("COMPANYNAME");
      private static final ID SEQUENTIALNUMBER      = ID.registerProperty("SEQUENTIALNUMBER");
      private static final ID ERRORDESC             = ID.registerProperty("ERRORDESC");
         //Events
      private static final ID EVT_OK  = ID.registerProperty("EVT_OK"); //custom event if all ok
      private static final ID EVT_ERR = ID.registerProperty("EVT_ERR"); //custom event if error occured
      // state machine variables
         long l_timeout;
         long l_wait_for = 5000; // pos terminal wait for command (5 seconds)
         long l_wait_for_transaction = 62000 * 2; // pos terminal timeout
         long l_second = 1000; // one second
         byte b_retry = 0;
         String dataValue = "";
      byte[] readBuffer = new byte[2000]; //2000 bytes buffer to read rs232 stream
         String comPort = ""; // local variable to store com port name
                                       // (COM1,COM2,...)
         String transactionType = "SALE"; // type of transaction to be executed (SALE
                                                      // or REFUND) default SALE
         String amount = "0"; // default amount value is set to 0
         //output paramerers
      String transactionProcessed = "";
      String transactionFlag = "";
      String transactionNumber = "";
      String batchNumber = "";
      String transactionDate = "";
      String transactionTime = "";
      String transactionAmount = "";
      String cardDataSource = "";
      String numberCustomerCard = "";
      String expirationDate = "";
      String terminalId = "";
      String merchandId = "";
      String companyName = "";
      String sequentialNumber ="";
      String errorDescription;
        public PosTerminalPjc() {
              super();
              System.out.println("============================");
              System.out.println("== State machine POS v1.0 ==");
              System.out.println("== Peter Valencic (c)     ==");
              System.out.println("== 03.04.2012             ==");
              System.out.println("============================");
        System.out.println("java.library.path: "+System.getProperty("java.library.path"));
              try {
                   res.load(this.getClass().getResourceAsStream("/res/language.properties")); // load language file
              } catch (Exception ex) {
                   System.err.println("Err loading language.properties file: "
                             + ex.toString());
      public void init(IHandler handler)
        super.init(handler);
        this.mHandler = handler;
        System.out.println("init handler ok");
        System.out.println("code base: "+handler.getCodeBase());
        //load dll from codeBase URL
        try
          String mylibName = "rxtxSerial.dll";
          String URLpath = "http://dekani:7777/forms/java/";
          System.out.println("URL: "+ URLpath + mylibName);
          URL libUrl = new URL(URLpath+mylibName);
          System.out.println("libUrlgetFile: " + libUrl.getFile());
          File file = new File(mylibName);
          System.out.println(file);
          if (!file.exists())
          file.createNewFile();
          URLConnection urlc = libUrl.openConnection();
          InputStream in = urlc.getInputStream();
          FileOutputStream out = new FileOutputStream(file);
          byte[] buffer = new byte[1048];
          int read;
          while ((read = in.read(buffer)) != -1){
             out.write(buffer, 0, read); // write
            out.close();
            in.close();
            System.loadLibrary("rxtxSerial");
        catch(Exception exc)
          System.err.println("Exception SystemLoadLibrary: " + exc.toString());
          this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_lib"));
      private void doTransaction() throws Exception {
        String sequentialNumber = ""+getRandomInteger(1000,9000,randomGenerator);
              String phase = null; // initial null value for state machine phase
              long l_ack_timeout = 0; //initial value for acknowledge timeout
              // com port check
              if (getComPort().trim().equalsIgnoreCase("")) {
                   this.showError(res.getProperty("s_dlg_err_title"),
                             res.getProperty("s_com_invalid"));
              if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_invalid"));
                                dispatchCustomEvent(ce);
                   return;
              // transaction type chek
              System.out.println(this.getTransactionType());
              if (!getTransactionType().equalsIgnoreCase("REFUND")
                        & !getTransactionType().equalsIgnoreCase("SALE")
            & !getTransactionType().equalsIgnoreCase("TICKET")
            & !getTransactionType().equalsIgnoreCase("VOID")
                   this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_tran_invalid_type"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_tran_invalid_type"));
                                dispatchCustomEvent(ce);
                   return;
              portList = portId.getPortIdentifiers();
              while (portList.hasMoreElements()) {
                   portId = (CommPortIdentifier) portList.nextElement();
          System.out.println(portId.getName());
                   if (portId.getName().equalsIgnoreCase(this.getComPort())) {
                        System.out.println("Port is used : "
                                  + portId.isCurrentlyOwned());
                        serialPort = (SerialPort) portId.open("ComDriver", 2000);
                        serialPort.setSerialPortParams(9600, SerialPort.DATABITS_7,
                                  SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN);
                        serialPort.notifyOnDataAvailable(true);
                        serialPort.notifyOnOutputEmpty(true);
                        os = serialPort.getOutputStream();
                        is = serialPort.getInputStream();
                        break;
              if (portId == null) {
              this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_com_not_found"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_not_found"));
                                dispatchCustomEvent(ce);
                   return;
        else if (portId.getName().equalsIgnoreCase(this.getComPort()) == false)
                  this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_com_not_found"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_not_found"));
                                dispatchCustomEvent(ce);
          return;
              // state machine infinite loop
              while (true)
                   // SEND DATA TO POS TERMINAL
                   if (phase == null)
                        System.out.println("start phase");
                        byte[] req = null;
                        //verify transaction type to be SALE or REFUND
                        //if REFUND then transaction number must be specified
                        if (getTransactionType().equalsIgnoreCase("SALE")) {
                             System.out.println("--> SALE send message to the pos terminal");
                             System.out.println("--> amount: " + amount);
                             req = protocolStream("000000"+sequentialNumber+"01100" + FS + amount + FS
                                       + FS + "+0" + FS + "978" + FS + FS + FS + FS + FS
                                       + FS + FS + ETX);
                        else if (getTransactionType().equalsIgnoreCase("REFUND")) {
                             System.out.println("--> REFUND send message to the pos terminal");
                             System.out.println("--> amount: " + amount);
                             System.out.println("--> transaction number: " + getTransactionNumber());
                             req = protocolStream("000000123405100" + getTransactionNumber() + FS + amount
                                       + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else if (getTransactionType().equalsIgnoreCase("VOID")) {
                             System.out.println("--> VOID transaction");
                             System.out.println("--> amount: " + amount);
                             System.out.println("--> transaction number: " + getTransactionNumber());
                             req = protocolStream("000000123410100" + getTransactionNumber() + FS      + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else if (getTransactionType().equalsIgnoreCase("TICKET")) {
                             System.out.println("--> TICKET duplicate");
                               req = protocolStream("000000123413100" + getTransactionNumber() + FS      + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else {
                             //nothing ;)
                        os.write(req);
                        os.flush();
                        l_ack_timeout = System.currentTimeMillis() + 1500;
                        //wait for half second
                        Thread.sleep(500);
                        l_timeout = System.currentTimeMillis() + l_wait_for; //add some time for timeout
                        phase = "TO_POS_ACK";
                        System.out.println("phase: " + phase);
                   }//phase null
                   //CHECK IF THE TIMEOUT OCCURED
                if (phase.equalsIgnoreCase("TO_POS_ACK") & (l_timeout < System.currentTimeMillis()) & (b_retry < 4))
                    b_retry += 1;
                    System.out.println("TIMEOUT: " + b_retry);
                    l_timeout = System.currentTimeMillis() + l_wait_for;
                    if (b_retry >= 4) {
                        System.out.println("Timeout occured");
                        closePort();
                        this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_timeout"));
                        break;
              //CHECK FOR THE ACKNOWLEDGE (FIRST RESPONSE FROM POS TERMINAL)
                if (phase.equalsIgnoreCase("TO_POS_ACK") &
                        (l_ack_timeout < System.currentTimeMillis())) {
                    try {
                        int numBytes = 0;
                        dataValue = "";
                        while ((numBytes = is.read(readBuffer)) > 0) {
                            dataValue += new String(readBuffer, 0, numBytes, "ASCII");
                        if (dataValue.getBytes().length > 0) {
                            System.out.println("->first byte: " +
                                dataValue.getBytes()[0]);
                            System.out.println("total length: " +
                                dataValue.getBytes().length);
                            //check for ack byte
                            if (dataValue.getBytes()[0] == 6) {
                                System.out.println(
                                    "<--ACKNOWLEDGE received from pos terminal");
                                phase = "WAIT_FOR_TRANSACTION";
                                l_timeout = System.currentTimeMillis() + l_wait_for_transaction;
                                System.out.println("-> wait for transaction response");
                    } catch (IOException ev) {
              //WAIT FOR TIMEOUT ON MESSAGE (watch dog timer)
                if (phase.equalsIgnoreCase("WAIT_FOR_TRANSACTION") &
                        (l_timeout < System.currentTimeMillis())) {
                    System.out.println(
                        "Error receiving response from pos terminal!!!");
                    closePort();
                    this.showError(res.getProperty("s_dlg_err_title"),
                                 res.getProperty("s_response_error"));
                  if (this.mHandler != null)
                    CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                    this.setErrorDescription(res.getProperty("s_response_error"));
                    dispatchCustomEvent(ce);
                    break;
              //WAIT FOR SOME DATA TO COME FROM POS TERMINAL OVER RS232
                if (phase.equalsIgnoreCase("WAIT_FOR_TRANSACTION")) {
                    try {
                        int numBytes = 0;
                        dataValue = "";
                        Thread.sleep(500);
                        while ((numBytes = is.read(readBuffer)) > 0) {
                            dataValue += new String(readBuffer, 0, numBytes, "ASCII");
                        if (dataValue.getBytes().length > 0) {
                            System.out.println("->first byte: " +
                                dataValue.getBytes()[0] + "|" +
                                dataValue.getBytes()[1]);
                            System.out.println("->ascii: " + dataValue);
                            System.out.println("total length: " +
                                dataValue.getBytes().length);
                            if (dataValue.indexOf("PREKINIL UPORABNIK") != -1) {
                                System.out.println(
                                    "Uporabnik je prekinil povezavo!");
                                  closePort();
                                //transaction cancelled by user s_user_cancel
                                this.showError(res.getProperty("s_dlg_err_title"),
                                             res.getProperty("s_user_cancel"));
                              if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_user_cancel"));
                                dispatchCustomEvent(ce);
                                break;
                            if (dataValue.indexOf("NAPACEN VNOS") != -1) {
                                System.out.println("Napačen vnos");
                                closePort();
                                //invalid user entry
                                this.showError(res.getProperty("s_dlg_err_title"),
                                             res.getProperty("s_user_invalid_entry"));
                               if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_user_invalid_entry"));
                                dispatchCustomEvent(ce);
                                break;
                            if (dataValue.indexOf("PROSIM POCAKAJ") != -1) {
                                System.out.println("<-- PROSIM POCAKAJ");
                                continue;
                            //preberemo podatke iz stringe terminala
                            if (dataValue.indexOf("SPREJETO") != -1) {
                                closePort();
                                System.out.println("<-- TRANSAKCIJA SPREJETA");
                                System.out.println(dataValue);
                                StringTokenizer st = new StringTokenizer(dataValue, "\034" );
                                String dv = st.nextToken();
                                sequentialNumber = dv.substring(6,10);
                                transactionProcessed = dv.substring(1, 3);
                                transactionFlag = dv.substring(13,15);
                                transactionNumber = dv.substring(15,21);
                                batchNumber = dv.substring(21,25);
                                transactionDate = dv.substring(25,31);
                                transactionTime = dv.substring(31,37);
                                transactionAmount = st.nextToken();
                                st.nextToken(); //Amount exponent
                                st.nextToken(); //Amount currency
                                cardDataSource = st.nextToken();
                                numberCustomerCard = st.nextToken();
                                expirationDate = st.nextToken();
                                st.nextToken(); // authorization code
                                terminalId = st.nextToken();
                                merchandId = st.nextToken();
                                companyName = st.nextToken();
                                System.out.println("================");
                                System.out.println(transactionProcessed);
                                System.out.println(transactionFlag);
                                System.out.println(transactionNumber);
                                System.out.println(batchNumber);
                                System.out.println(transactionDate);
                                System.out.println(transactionTime);
                                System.out.println(transactionAmount);
                                System.out.println(cardDataSource);
                                System.out.println(numberCustomerCard);
                                System.out.println(expirationDate);
                                System.out.println(terminalId);
                                System.out.println(merchandId);
                                System.out.println(companyName);
                                if (this.mHandler != null)
                                  System.out.println("dispatch custom event");
                                  CustomEvent ce = new CustomEvent(this.mHandler, EVT_OK);
                                  dispatchCustomEvent(ce);
                                return;
                    } catch (IOException ev) {
                      System.err.println("Exception sm: " + ev.toString());
                System.out.print('*');
                Thread.sleep(200);
              }//end state machine loop
          * protocolStream prepare the stream to be send over RS232 to POS terminal
          * with LRC cheksum control
          * @param data
          * @return byte[]
         private byte[] protocolStream(String data) {
              char STX = (char) 0x02;
              String tmp = "" + STX + STX + data + "" + getLRC(data);
              System.out.println("PStream: " + tmp);
              for (int i = 0; i < tmp.getBytes().length; i++) {
                   System.out.print(tmp.getBytes() + ":");
              return tmp.getBytes();
    * close port and stream
    private void closePort()
    try {
    serialPort.close();
    is.close();
    os.close();
    } catch (Exception ee) {
         * Longitudinal Redundancy Check (LRC)
         * @param packet
         * @return String
         private String getLRC(String packet) {
              char[] splitPacket = packet.toCharArray();
              char lrc = 0x00;
              for (int x = 0; x < splitPacket.length; x++) {
                   lrc = (char) (lrc ^ splitPacket[x]);
              return "" + (char) lrc;
         private String paddingString(String s, int n, char c, boolean paddingLeft) {
              if (s == null) {
                   return s;
              int add = n - s.length(); // may overflow int size... should not be a
              if (add <= 0) {
                   return s;
              StringBuffer str = new StringBuffer(s);
              char[] ch = new char[add];
              Arrays.fill(ch, c);
              if (paddingLeft) {
                   str.insert(0, ch);
              } else {
                   str.append(ch);
              return str.toString();
    public boolean setProperty(ID id, Object value)
    if (id.toString().equalsIgnoreCase("COMPORT")) {
    setComPort((String)value);
    System.out.println("RS232 com port: " + getComPort());
    return false;
    if (id.toString().equalsIgnoreCase("AMOUNT")) {
    this.setAmount((String)value);
    System.out.println("Amount value: " + getAmount());
    return false;
    if (id.toString().equalsIgnoreCase("TRANSACTIONTYPE")) {
    this.setTransactionType((String)value);
    System.out.println("Transaction Type value: " + this.getTransactionType());
    return false;
    if (id.toString().equalsIgnoreCase("EXECUTE")) {
    System.out.println("Invoke pos terminal");
    try
    doTransaction();
    catch(Exception ex)
    System.err.println("Execute Exception>> " + ex.toString());
    this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_gen_exception"));
    return false;
    return false;
         * Display error message inside oracle form
         * @param title
         * @param exceptionString
         private void showError(String title, String exceptionString) {
              JOptionPane.showMessageDialog(this, exceptionString, title, 0);
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:18 AM
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:20 AM
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:21 AM

  • Identifying a comm port using java communication API

    HI ALL,
    i'm using the communication API to detect the comm port to which my modem is attached.
    i say CommPortIdentifier c = CommPortIdentifier.getPortIdentifier("COM3");
    then i SOP(c.getName())
    i get an exception saying noSuchPortException
    i've put the javax.comm.properties file in jdk/lib but to no avail.
    i also have a win32com.dll file that is there inside lib.
    but this hasn't helped. Now the properties file has a driver mentioned. do i have 2 download that driver or does it come with the OS (i've no idea)
    i would be helpful if anybody could help me out with this problem.

    Try putting tha javax.comm.properties file in you <java>/jre/lib folder as well... It worked for me !

  • How do I pragmmatic​ally determine what comm ports my serial instrument​s are on?

    I am building a test stand that incorporates 5 serial instruments; 2 digital loads and 3 power supplies. I can use my PC's device manager to figure out which comm port each device is on and set the VISA Resource Name so everything runs as expected. All is well at this point. The problem comes in when an instrument's USB connection is unplugged and replugged, at which point the system may renumber the port assignments; the result is that my program errors out, I have to figure out what port everything is on all over again, and change the VISA Resource Name for all of my instruments. While this is a minor annoyance for me as the developer, this would make the program unusable by the user.
    While "don't ever unplug an instrument" is a sensible answer, the fact is that these things happen from time to time - like for calibration - so I want the program to work regardless of instruments being unplugged.
    Is there a way to have the vi automatically identify what port each instrument is on?

    I've used a USB connected barcode scanner that appears as a COM port. If it is left connected to the same USB port the COM port remains constant but if it is disconnected and then put back into a different port the COM port changes. This sounds similar to your problem so I'll share how I solved things for my application.
    The scanner I use accepts commands and will respond with a known string when I send a character 'I' via the serial connection. Using this I can see if the scanner is connected to the expected COM port (default port is stored in an ini file).
    If this fails I create an array of possible serial ports by trying to open COM1 and checking for an error. If this does not generate an error I add it to an array. Next I try the same with COM2, COM3 up to COM16 (for example). This gives me a list of COM ports I can open.
    I then iterate through the array trying for a response and stopping either when I get the expected response and continuing with the application or if the device is not found by the time I get to the end of the array I show the appropriate error condition to the operator.
    If your instruments can return some kind of ID that will allow you to identify them as mentioned in another reply then this method could be used. Your 3 power supplies and 2 digital loads would need to be able to return a unique identifier otherwise you wouldn't be able to tell them apart and I think you'd possibly run in to problems.

  • Reading Data from serial (Comm) Port in developer200 forms 6i

    Dears,
    I have developed an application using Dev2k forms 6i.
    I need to read data from a device (weigh bridge) that is attached to PC on comm port.
    scenario: when a vehicle comes on the Weigh bridge it calculates its weight and send it to the PC on serial port.
    on when-button-pressed event I want to get data into a text field on form.
    If any one has developed such form please help me.
    Thanks and regards

    you can:
    create java class -> wrap plsql -> invoke plsql-code from button trigger
    googling java class instead of creating =)

  • Associating a comm port with a TS test socket

    Hello,
    In order to run several test platforms on one machine (parallel model), I must be able to associate each test socket with a unique serial port. Each hardware platform has it's own serial connection which is built in Labview. So my question is, "how can I use a single test sequence calling LV VIs where each test socket must use a different comm port?"
    Thank you for helping,
    Adam

    How dynamic is the com port configurations? Will some testers only differ in the number of ports? If that's the case, then you'll also need to dynamically change how many sockets you're testing. This could be done, probably in a sequence file load callback and with the LabVIEW function VISA Find Resource. Searching for all ASRL resources will return a count and their names. You could populate a station global string array with the names. Right now, I have a fixed count of resources so I just populate a main sequence local variable with all of the possible names. I assign the resource name for the VI as Locals.VISAResource and in a pre-expression for the VI, Locals.VISAResource = Locals.AllVISAResources[RunState.TestSockets.MyIndex]

  • Accessing RS232 Port (Comm Port) from Applet

    I have an interesting "problem". I would like to create an applet that allows me to read the Comm port of the client machine but obviously I get a security exception when I try to do this. Firstly is this possible (I know it can be done from an application)? If so, how would I go about doing it?
    Thanks,
    Rishi

    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!

  • How to open the comm ports?

    Hi,
    im using javacomm to detect my comm ports.i have two serial
    and a parallel port (com1,com2 and LPT1) but it found no ports and throws
    as follows,
    found: javax.comm.CommPortEnumerator@e83912
    found: 0 open ports
    i placed .properties file in ..\jdk1.5.0\jre\lib
    comm jar file in ..\jdk1.5.0\jre\lib\ext
    and WIN32COM.DLL in ..jre\bin
    am i doing right?
    Here is the code,
    import javax.comm.CommPortIdentifier;
    import javax.comm.SerialPort;
    import javax.comm.PortInUseException;
    import java.util.Enumeration;
    import java.util.Vector;
    public class TestEnumeration {
    public static void main(String args[]) {
    Vector portslist = TestEnumeration.getAvailableSerialPorts();
    System.out.println("found: "+portslist.size()+" open ports");
    public static Vector getAvailableSerialPorts() {
    CommPortIdentifier pId=null;
    SerialPort sPort=null;
    Enumeration pList=null;
    boolean foundport=false;
    pList = CommPortIdentifier.getPortIdentifiers();
    String port=null;
    Vector ports=new Vector();
    if(!pList.hasMoreElements()) {
    System.out.println("found: "+pList);
    return ports;
    while (pList.hasMoreElements()) {
    pId = (CommPortIdentifier) pList.nextElement();
    if (pId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    foundport=true;
    try {
    sPort = (SerialPort)pId.open("serialport", 1000);
    } catch (PortInUseException e) {
    foundport=false;
    System.out.println(pId.getName()+ " is closed");
    } finally {
    if(sPort!=null) {
    try { sPort.close(); } catch(Exception e) {}
    if(foundport) {
    ports.add(pId.getName());
    System.out.println(pId.getName()+ " is open");
    return ports;
    please help me on how to open the comm ports..

    Try this, It workd for me. Before doing this make sure you have serial ports on you r computer by following these steps:
    open "regedit"
    go to "HKEY_LOCAL_MACHINE" > HARDWARE > DEVICEMAP
    and check if there is any serial ports. If htere is any, then use following program to enumerate throught the ports:
    class SimpleRead() {
    portList = CommPortIdentifier.getPortIdentifiers();
         while (portList.hasMoreElements()) {
         portId = (CommPortIdentifier) portList.nextElement();
         if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
              if (portId.getName().equals(defaultPort)) {
              System.out.println("Found port: "+defaultPort);
              portFound = true;
              SimpleRead reader = new SimpleRead();
         if (!portFound) {
         System.out.println("port " + defaultPort + " not found.");
    }

  • Solving Prolific PL-2303 USB to Serial Comm Port installation issues

    Hello everybody,
    More and more machines are comming without Parallel and serials ports, they are comming with USB external ports only.
    Some have the RS-232 and Parallel headers in the motherboard, and that should last for about a year I think.
    At any rate, the issue I was facing is the following:
    (a) Installing Prolific PL-2303 USB to Serial Comm Port on Windows XP Pro SP3 works OK and system runs fine. there are some capacity issues regarding the buffer size, but that is another post.
    (b) Installing on WEPOS 1.1 SP3 on some motherboards (Older ones) that have at least the Parallel headers and a serial port, the device also works as with (a)
    (c) Installing on WEPOS 1.1 SP3 with a machine with only external USB's (no parallel / serial port or headers). The installation process runs OK. but when the device
    is plugged I get the following error message:
    "An error ocurred during the installation of the device"
    "A service Installation section in this INF is invalid"
    (d) Installing on POSReady 2009. I get the same as with (c)
    This is how I solved, after many frustrating reboots with the same message about the INF section and multiple Prolific drivers tried.  I started digging windows:
    (1) Find the setupapi.log and read it, if the OS is a fresh install it will not be too long.
    (2) Read this:
    #-166 Device install function: DIF_SELECTBESTCOMPATDRV.
    #I063 Selected driver installs from section [ComPort] in "c:\windows\inf\oem15.inf".
    #I320 Class GUID of device remains: {4D36E978-E325-11CE-BFC1-08002BE10318}.
    #I060 Set selected driver.
    #I058 Selected best compatible driver.
    #-166 Device install function: DIF_INSTALLDEVICEFILES.
    #I124 Doing copy-only install of "USB\VID_067B&PID_2303\5&B6C3FC&0&2".
    #-166 Device install function: DIF_REGISTER_COINSTALLERS.
    #I056 Coinstallers registered.
    #-166 Device install function: DIF_INSTALLINTERFACES.
    #-011 Installing section [ComPort.NT.Interfaces] from "c:\windows\inf\oem15.inf".
    #I054 Interfaces installed.
    #-166 Device install function: DIF_INSTALLDEVICE.
    #I123 Doing full install of "USB\VID_067B&PID_2303\5&B6C3FC&0&2".
    #-035 Processing service Add/Delete section [ComPort.NT.Services].
    #E339 Add Service: Binary "C:\Windows\system32\DRIVERS\serenum.sys" for service "Serenum" is not present.
    #E032 Error 0xe0000217: A service installation section in this INF is invalid.
    #E275 Error while installing services. Error 0xe0000217: A service installation section in this INF is invalid.
    #E122 Device install failed. Error 0xe0000217: A service installation section in this INF is invalid.
    #E154 Class installer failed. Error 0xe0000217: A service installation section in this INF is invalid.
    [2010/02/13 23:32:24 2004.2]
    (3) So it was the serenum.sys file that Windows needed to find in the ..\system32\drivers folder. I got the serenum.sys from one of the temporary folders created by the installation process.
    (3a) So, I think that windows installs this sys file if it recognizes the motherboard has at least one parallel or serial port.
    (4) So good luck when installing your serial device to your POS solution. I will open another thread if I have problems with the buffer size of the device.
    Humberto Sequeira

    Hello Terry,
    Indeed, they were not intended as POS system, the EEE Top machines are candy to the eye, but for my taste they do not work in POS environment (I give them 1 year before they pop). Regarding the other, well competition is tought, so you have to get creative in order to keep costs down, and this one can be used as a waiter stations, that do not need heavy serial comunications.
    Anyways, the POSReady does not install these system files if the installation does not detect a serial or parallel port (which make sense, as why would it install drivers for a device that is not detected). I posted this for others to be aware of this when they select the hardware that will be offered to their customers, as good old "on mother-board" serial and parallel ports cannot be beaten by their USB imitations (IRQ and memory addressing processing are needed for end devices to function properly).
    Have a great weekend,
    Humberto

  • Reading the Comm Port of PC

    hi  friends
    We have a requirement to read the <b>Comm port</b> of the a local PC to get some data....so is that possible by any means from SAP r/3 system......

    Look at the methods of the class; CL_GUI_FRONTEND_SERVICES in se24.
    The method GET_IP_ADDRESS would get you the IP Address.
    Regards,
    Ravi

  • Wiring FP-1001 to a comm port on my computer?

    I am trying to wire my FP-1001 to my PC. I purchased a 9pin serial port connecter in hope that all I had to do was plug the female end into comm port one, splice the other end and connect them to RX+, RX-, TX+, TX- and GND. My only problem is how do I know which wires go where? Or do I need to purchase a RS-485 card for my PC.

    Hi all
    That is not quite true!National Instruments is selling PCI-485 boards with two, four or eight ports.
    Under this link you find a quick start guide how to connect the FP-1001 to a RS-485 port.
    http://digital.ni.com/manuals.nsf/webAdvsearch/554FEB385A006C8E86256AC300647F62?OpenDocument
    Regards,
    Luca

  • HP 6550b BIOS Unabled COMM PORT (SERIAL)

    Hi,
    I have an HP Probook 6550b with BIOS version F.23, I can see my Ricoh PCI connections like USB, SD/MMC Reader and the 1394 Port, but I can't found my Serial COMM PORT??
    Thx for your Help!

    Hi:
    Did you install the AMT driver?
    http://h20565.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdDetails/?sp4ts.oid=3688870&sp...

  • Comm port enumeration

    Hi,
    im using javacomm to detect my comm ports.i have two serial
    and a parallel port (com1,com2 and LPT1) but it found no ports and throws
    as follows,
    found: javax.comm.CommPortEnumerator@e83912
    found: 0 open ports
    i placed .properties file in ..\jdk1.5.0\jre\lib
         comm jar file in ..\jdk1.5.0\jre\lib\ext
    and WIN32COM.DLL in ..jre\bin
    am i doing right?
    Here is the code,
    import javax.comm.CommPortIdentifier;
    import javax.comm.SerialPort;
    import javax.comm.PortInUseException;
    import java.util.Enumeration;
    import java.util.Vector;
    public class TestEnumeration {
    public static void main(String args[]) {
    Vector portslist = TestEnumeration.getAvailableSerialPorts();
    System.out.println("found: "+portslist.size()+" open ports");
    public static Vector getAvailableSerialPorts() {
    CommPortIdentifier pId=null;
    SerialPort sPort=null;
    Enumeration pList=null;
    boolean foundport=false;
    pList = CommPortIdentifier.getPortIdentifiers();
    String port=null;
    Vector ports=new Vector();
    if(!pList.hasMoreElements()) {
    System.out.println("found: "+pList);
    return ports;
    while (pList.hasMoreElements()) {
    pId = (CommPortIdentifier) pList.nextElement();
    if (pId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
    foundport=true;
    try {
    sPort = (SerialPort)pId.open("serialport", 1000);
    } catch (PortInUseException e) {
    foundport=false;
    System.out.println(pId.getName()+ " is closed");
    } finally {
    if(sPort!=null) {
    try { sPort.close(); } catch(Exception e) {}
    if(foundport) {
    ports.add(pId.getName());
    System.out.println(pId.getName()+ " is open");
    return ports;
    please help me on how to open the comm ports..

    hi,
    thanks for your reply..actually my problem was with my comm properties file and i replaced with the new comm file then..now its working fine..
    Thanks for everyone...
    bye

  • Comm port passthrough

    Customer has an old Windows 2003 SBS server that has a Novatime time clock plugged into it via a comm port.
    They now have a new server running 2012 (not R2) in Hyper-V role only with 4 2012 VMs (all licensing correct). They want to get rid of the old server (need to) but
    the time clock prevents that.
    I know we can get a serial 2 USB adapter cable so the time clock can be plugged into the Hyper-V server. Is there any way to pass through the USB comm to one of the VMs
    which would have the Novatime software on it? Would it require a comm card to be added to the Hyper-V server?
    Jonathan

    i think your best bet would be this product (haven't tested it): http://www.serial-server.net/port-redirector/ afaik COM redirection isn't supported on Hyper-V.
    Some people seem to have tested it and shared findings on the matter in this thread: http://social.technet.microsoft.com/Forums/windowsserver/en-US/a7b09e73-3491-405e-889e-06bb991a2b0e/com-port-redirection-physical-to-virtual
    Kind regards, Philipp - Solid IT Solutions
    Philipp,
    thanks for your response. I read through the links you provided and the first one certainly looks like it will do what I need.
    Jonathan

Maybe you are looking for

  • HowTo: The SSH2 PHP Extension and You

    Until a few days ago, I didn't care about the SSH extension for PHP. I didn't have a use for it. Why should I care. Then I discovered that Wordpress' autoupdate feature wouldn't work without it (if you use SFTP, like I do). Oh. Maybe I need this thin

  • How to Track Online Changes in IT0002 using BADI

    Iam trying to capture old_image and new_image of IT0002 when ever there is a change in IT0002 through PA30. once i track i need to update the details in a customised table to interface with external system. May i know how can i track the online chang

  • Class Not found : oracle.jdbc.driver.OracleDriver when calling web service

    Hi, I have installed the Oracle Data Integrator Public Web Services on Apache Tomcat 5.5 application server with Apache Axis2 When I try to call the web service OdiInvoke using the operation "listScenario" using only the JdbcDriver as input parameter

  • HR_INFOTYPE_OPERATION from dynamic action?

    hi plz send me the sample code for calling subroutine (using the above mentioned FM) from dynamic action .. Regds Gunjan

  • Processing and Released Status when we create a new Condition table

    Hi all I created a new condition table in M/03, and assigned one field to it, Generated and saved. Then added the condition table in the access sequence. There appeared two more lines below the field that i have assigned. One is Processing status and