Writing to serial port 1 from a PDA

ok this program is driving me NUTS! i have this microchip which uses a certain protocol... now this protocol requires that you send it some characters in hexadecimal so it'll reset... afterwhich it'll send you a data packet containing the version of the microchip etc etc (it's an aduc812... which you can find on www.analog.com)... anyway, that's not important... i am having trouble actually WRITING to serial port 1... i noticed that doing it through an actual PC requires some sort of "open serial port.vi" which is not available in the pda version... all i have is init.vi which is apparently not enough from what i am told... i thas to be opened first... initialized next... then written to then read from... does anyone know how i can acc
omplish this open procedure with the pda module? is that some sort of software i'm missing? why isn't it included with the pda module add on... etc etc... thank you in advance... i really need help with this so as much information as possible would be appreciated... let me know if you need further info...
christina

Hey Christina,
Here is a link to a knowledge base one simply writing to the serial port from a PDA.
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=E011F478861443EFE034080020E74861&p_node=%20DZ52363&p_source=External
Hope this helps.
Brett

Similar Messages

  • Writing to serial port

    I currently send ASCII characters to a serial port. I have not errors reported back. Everything appears to be error free, except that the device that I am trying to control does nothing. The device being controlled does not send anything back to the pc. The connection is strictly a one way connection. Do you have to send a carriage return or something to get the ASCII characters to "push" out of the buffer? - Sorry I don't have access to my code at the moment.

    A portion of my code is below. What does the 'flush'
    do? I thought it just emptied out the buffer.
    while (portList.hasMoreElements()) {
    portId = (CommPortIdentifier)
    tIdentifier) portList.nextElement();
    if (portId.getPortType() ==
    ortType() == CommPortIdentifier.PORT_SERIAL) {
    if (portId.getName().equals("COM1"))
    .equals("COM1")) {
    try {
    serialPort = (SerialPort)
    portId.open("SimpleWriteApp",
    d.open("SimpleWriteApp", 2000);
    } catch (PortInUseException e)
    ortInUseException e) {}People get life for this crime!
    try {
    outputStream =
    outputStream =
    tStream = serialPort.getOutputStream();
    } catch (IOException e) {}So you now have two life sentences to serve.
    try {
    serialPort.setSerialPortParams(9600,
    SerialPort.DATABITS_8,
    SerialPort.STOPBITS_1,
    SerialPort.PARITY_NONE);
    } catch
    } catch
    } catch (UnsupportedCommOperationException e) {}Sorry, three life sentences to serve.
    try {
    outputStream.write(rightString.getBytes());
    } catch (IOException e) {}You get the prize! Four life sentences from a short bit of code.
    }P.S. You should really use the COMM api for writing to serial ports.

  • Problem writing to serial port

    Hi All,
    I am very new to LabVIEW (just a couple of months). I need to communicate with a serial port of an Advanced Energy RF generator (Ovation) serial port (AE Bus)
    The manual talks about little endian conversion, CSR and checksum that I just can't make it work. does anybody know how to write and read to this serial port?
    I have used the write and read to serial port from examples with no luck and no response from the generator. I have attached the generator's manual here, the serial commands section starts at page 65 (4-25)
    Has anybody written a program to talk to Ovation RF generator? can anybody help me out and get me started? I am stuck!!!. ... appreciate your help. thanks.
    ~Johnny
    ~ Johnny
    Attachments:
    Ovation - AE RF generator.pdf ‏1444 KB

    Thanks... so I started with the basic serial write and read, enetered hex text strings into the serial write, including the checksum and what I read back is not always correct because for example I need to calculate the XOR in the program and not just eneter it as a hex value. I should also put the write and read into a loop because I will be writing and reading to serial port 2 dozen times.
    I am working with two devices, one is the generator, the other is a controller board that has a very similar serial bus structure as the generator's AE serial bus. the controller board has stepper motor drivers that move two variable capacitors. for the generator, I need to turn the power on and off and set to different power levels. for the control/stepper motor driver board: I need to read the values from a text file(attached). the text file has 3 table, table1, column1 is the number of steps that the stepper motor will move and column2 is the nominal capacitor values for C1. same thing table2; values are number of steps versus nominal cap values for C2. I need to creat a matrix such that to move the C1 to steps listed in the table, and for every step increment in C1, I need to move the C2 motor to 20 different position (listed in the table3 that has the desired percent value of total capacitance ) position and make a measurement of the impedance of the capacitors with agilant E5061 network analyzer and write the data back into the same text file at the end where it says "IMPEDANCE_REAL     in Ohm    one line per C1 position"  and into a excel sheet too while taking a measurement... and do the same thing all over again for C2 versus C1. I think  I need to use the producer consumer design pattern eventually when I get the details worked out first.
    any suggestion? .... much thanks.
    ~ Johnny
    ~ Johnny
    Attachments:
    Basic Serial Write and Read1.vi ‏24 KB
    cap-table.txt ‏7 KB

  • After writing into serial port, the same message gets bounced back into the Inqueue also. If anyone know how to avoid this, please rpely.

    Hi,
    After writing into serial port, the same message gets bounced back into the Inqueue also. If anyone know how to avoid this, please reply.
    Thanks,
    Ganesh

    If you disconnect the cable going to the serial device, do you still get the echo? If so you have something going on in the port setup. If disconnecting the cable stops the echo then the device you're talking to is doing it - which would be my bet. One thing to check is whether this might not be normal operation. I have seen devices that if a command was successful, it simply echo'd back the command string you had sent. Also many serial devices have setting for specifying whether they are to echo commands.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Reading/writing to serial port w/ VISA in Labview

    I'm writing a Labview program to control and to read data from a Varian vacuum pump controller. It is connected to the serial port in my computer, and I have been trying to open a VISA session to communicate with the instrument. So far, however, the computer cannot see the instrument--I get the same error messages reading and writing to the instrument as I do to an empty serial port. Does anyone have any suggestions on what the problem might be? Thank you.

    There are a lot of possiblities. Is the cable correct? You probably need a crossover cable (TX and RX) swapped. You also need to check and make sure the serial ports on both ends are set the same (i.e. baud rate, handshaking, stop bits, etc.). Make sure that the port is enabled. I've seen people try to use a comm port only to find that a modem card installation caused the port to be disabled. You could also try using hyperterminal to talk to the instrument. If you can communicate there, you can eliminate any hardware problem.

  • Serial port: from 6i without visa to 7express with visa ?????

    upgrading from NT4 6i max 2.5 to 2000 7exp max3.1 my pzt on PC serial port do not move anymore. The DA converter do not understand the instructions.
    Running max on the coms: done OK
    Looping back the visa instructions: done instructions OK
    Trying hyperterminal: done OK (the DAC move)
    the coms are in function but the DAC do not move while driving with visa...any suggestion??

    I also upgraded from LV6.1 to LV7 and use serial communication. I now use VISA (and prefer it). However, for the older functions.. they should work..
    Have you looked into the VISA Advanced controls under Interface Specific and under "Serial". You may find the functions you need to "upgrade" your serial comm vi's.
    -JLV-

  • How send data to serial port from forms 6i

    How send data to serial port to activate hardware connect.
    The hardware is a drawer for cash the point of sales.

    Andres,
    I do the exact thing you are looking for,
    I spool out a text file using text_io
    the file will either contain a double ^G or an epson escape sequence, depending on the drawer type connected.
    I then copy this file to the port using a copy function id d2kwutil
    Works perfectly, but god knows how I'll do it if we want to run the point of sale over the web :)
    John

  • Error while reading/writing to serial port

    Hello,
    I am trying to read/write to my serial port but
    this message shows every time i launch the
    program. Does anyone know some help ?
    Thanks
    FdB
    Attachments:
    error2.ppt ‏172 KB

    Frederico
    This VI (LV8)
    1. Open the serial port at 2400 baud
    2. Powers down the PT104 and wait 0.5 secs for this to settle
    3. Flushes the serial power buffer to remove any power down acknowledgements in the serial buffer
    4. Powers up the PT104 waits 1 sec for things to settle
    5. Reads any bytes in serial rx buffer.
    6. Power down the PT104
    7. Close the COM Port.
    This is a bit of a guess but this is how I would approach it. Can you try this and let us know how you get on?
    thanks
    David
    Message Edited by David Crawford on 07-20-2006 10:31 AM
    Attachments:
    PT104 - Get Version at Power Up.vi ‏56 KB
    PT104 - Get Version at Power Up.jpg ‏50 KB

  • Reading and Writing For Serial Port (RS232)

    Hi there;
    I want to send data from my comport to a device and take data from there. I use Windows operating system. I looked at a bit javax.comm and RxTx.
    Firstly do i have to use RxTx for my project because of i am using Windows operating system?And;
    Where should i began to start simply send and receive data via RS232?
    Edited by: furkankamaci on Feb 14, 2009 8:05 AM

    Use RxTx and follow its examples.

  • Problems with access to serial port using reentrant code

    Hi,
    I have a VI that send commands and receive answers from an instrument using
    de serial port.
    This VI runs perfectly when used alone.
    However I'm trying run two instances of that VI simultaneously using
    reentrant code and I'm facing some problems.
    Sometimes everything is OK but sometimes, in the process of writing to
    serial port the following error happen:
    Error code 36.
    Invalid refnum device.
    What is this?
    Does someone know how to prevent this?
    Thanks in advance for any help.

    "Paro, Paula [CMPS:2721:EXCH]" wrote:
    >
    > Hi,
    >
    > I have a VI that send commands and receive answers from an instrument using
    > de serial port.
    > This VI runs perfectly when used alone.
    > However I'm trying run two instances of that VI simultaneously using
    > reentrant code and I'm facing some problems.
    > Sometimes everything is OK but sometimes, in the process of writing to
    > serial port the following error happen:
    > Error code 36.
    > Invalid refnum device.
    >
    > What is this?
    > Does someone know how to prevent this?
    >
    > Thanks in advance for any help.
    You can't use reentrant vi's vith serial vi calls without supervising of
    driver.
    Use VISA instead and you have to control the VISA session opening and
    closing. Another word is that the only one serial port sess
    ion should be
    opened at a time.
    Reentrant vi's for serial port without checking serial port session is a
    mistake of program algorithm. Change it in any convenient way.
    Sergey Krasnishov
    Automated Control Systems
    National Instruments Alliance Member
    Moscow, Russia
    [email protected]
    http://acs.levsha.ru

  • J2ME in Pocket PC - sockets - serial port

    Hi Guys,
    I am writing a J2ME application for a Pocket PC using Windows Mobile 2003
    I have chosen the J9 VM to run my J2ME applications on the PPC.
    My application will use tcp/ip sockets communication to connect to a server. Do you know if there are any issues of using this part of J2ME on a Pocket PC?? ( I have tested the same application on Java enabled mobile phone and it is fine)
    I also want to access the serial port from my J2ME application (read/write data). Do you know if it is possible to do it on a Pocket PC through the normal way?? (using the javax.microedition.io package??)

    evelknievel you said that implemmented bluetooth
    connection like a serial link, where can i find some
    documentation to do that?i am sorry, that i cannot offer you a link to a tutorial, because i just tried it out by myself using an iPAQ h5550 with windows CE 4.2 (i think this is equivlent to PocketPC 2003, or 2003 SE) which is able to create such connections. the bluetooth-driver of each side of your "serial bluetooth link" has to implement the so called "serial port profile". maybe you should google for it...
    i found some information on this:
    "To open the connection using the:
    * PocketPC
    o Most Bluetooth drivers for PocketPC provide the mapping between Bluetooth serial ports and virtual COM (inbound/outbound) ports. For example WIDCOMM Bluetooth driver (BTW-CE 1.4) that comes with hp iPAQ h5550 by default assigns COM port 5 as the inbound Bluetooth serial port and COM port 8 as the outbound Bluetooth serial port. These COM ports are configurable from the driver's Bluetooth manager."
    i found it here:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/15987c8cb752ead786256dc20070b433?OpenDocument
    hopefully this information is useful to you or anybody else :)
    best regards
    evelknievel

  • Java Serial Port Question !

    Hello,
    I am writing characters such as "open\r", "close\r" to the serial port of a PC from the Java program. This PC is connected to robot controller through the serial port.
    Suppose, I am writing open\r to the serial port. After writing open\r, the controller immediately echos "open" back to the serial port, which my Java program can read & print. Then, approximately after 1 second, when the robot actually executes the open (Open Gripper) command, the controller sends "Done.>" this response. I want to monitor & read this response "Done.>" because I want to check controller's response ("Done.>") before sending next command.
    1. Is it MUST to listen & read data at port at the time the data comes? Does the data gets lost if we don't read the data at the time it comes? For example, if data comes at 10000 millisecs, then is it MUST to start reading at 10000 or 10001? Would that data get lost if we start reading after say 3 seconds i.e. at 13000?
    2. If some data ("Done") comes at the serial port from controller and the Java program does not read that and if suppose more data (".>")comes at the serial port after 1/2 second, then does the previous data("Done") gets erased?
    3. My problem is --> the java program that I have written, can sometimes read & print controller's response --> "Done.>" and other times it does not find "Done.>"....That means the data --> "Done.>" is getting lost somewhere or Java program is not able to read it..The controller always sends "Done.>" when it excecutes "open" command.
    Thank You !
    Mayur
    Below is the code I am using...
    import java.io.*;
    import java.util.*;
    import javax.comm.*;
    public class WriteReadEdit implements SerialPortEventListener {
    CommPortIdentifier portId;
    Enumeration portList;
    OutputStream outputStream;
    InputStream inputStream;
    SerialPort serialPort;
    public static void main(String[] args) {
              String command1 = "open\r";
              String command2 = "close\r";                    
              boolean EndCharacterQMark = false;
              WriteReadEdit readObject = new WriteReadEdit();
                   readObject.Write(command1);
                   try {
                        EndCharacterQMark = readObject.waitUntilDataComes();
                        System.out.println("EndCharacterQMark is: " + EndCharacterQMark);
                   }     catch (IOException e) {}
                        if(EndCharacterQMark) {
                             EndCharacterQMark = false;
                             readObject.Write(command2);
                             try {
                                  EndCharacterQMark = readObject.waitUntilDataComes();
                                  System.out.println("EndCharacterQMark is: " + EndCharacterQMark);
                             }     catch (IOException e) {}
                        readObject.closePort();
    synchronized boolean waitUntilDataComes() throws IOException {
         String total="";
         boolean EndCharQMark = false;
         StringBuffer inputBuffer = new StringBuffer();
         int newData = 0;
         while(true) {
                        if(!dataAvailable()) {
                             try {                              
                                  wait();                              
                             }catch (InterruptedException e) {}
                   try {
                        while (newData != -1) {                         
                             newData = inputStream.read();
                             inputBuffer.append((char)newData);
                   }          catch (IOException ex) {
                             System.err.println(ex);
                        String dataAtPort = inputBuffer.toString();
                        for(int i = 0; i < dataAtPort.length(); i++) {                         
                                  if(dataAtPort.indexOf("?")>1 || dataAtPort.indexOf(">")>1 ) {
                                  EndCharQMark = true;
                                  return EndCharQMark;
    boolean dataAvailable() throws IOException {          
         return inputStream.available() > 0;
              void Write(String commandToSend) {
              String command = commandToSend;
              try {
                        outputStream.write(command.getBytes());                              
                        System.out.println("\nSuccessfully Written: " + command);
              } catch (IOException e) {System.out.println("IO Exception Occured: " + e);
    void closePort() {
         serialPort.close();
         System.out.println("Port closed successfully.");
    // Constructor()
    public WriteReadEdit() {
              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("writereadobjectApp", 2000);
                   System.out.println("Opened the port for writing: " + portId.getName());
              } catch (PortInUseException e) {
              try {
                   serialPort.setSerialPortParams(9600,
              SerialPort.DATABITS_8,
              SerialPort.STOPBITS_1,
              SerialPort.PARITY_NONE);
              } catch (UnsupportedCommOperationException e) {
                                            System.out.println("UnsupportedCommOperationException, Could not set the port: " + e);
                                       try {                                        
                                            outputStream = serialPort.getOutputStream();
                                            inputStream = serialPort.getInputStream();
                                       } catch (IOException e) {
                                       try {
                                            serialPort.addEventListener(this);
                                       } catch (TooManyListenersException e) {}
                                       serialPort.notifyOnDataAvailable(true);
    synchronized public void serialEvent(SerialPortEvent event) {
         switch(event.getEventType()) {
         case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
         case SerialPortEvent.DATA_AVAILABLE:
         notifyAll();          
         break;

    1. Usually there are buffers in the serial port controller. Apart from that, as long as the port is open, any data recieved will be added at the end of the InputStream of the comport so nothing will be lost.
    2. Nope, see above. But there might just be some kind of limit there.
    3. Download portmon http://www.sysinternals.com/ntw2k/freeware/portmon.shtml or any other prog that is able to monitor what's happening on you're serial port. This allows you to see if the response is really send by the robot.
    You're code seem to me to be more complex then it needs to be. Check out javax.comm.CommPort.enableRecieveTimeout(int). Setting a timeout will cause the the read function to return when the timeout is passed or data is recieved. A timeout of of say 4sec whould make sure that when a reply is send, it is recieved and it's stops reading when it gets no reply.
    In that case you could do with a sendMsg function wich dus not return until the correct response is recieved, or the timeout passed.
    You migth consider putting all the communicatoin with the com port in a different Thread so the rest of the program runs on when that thread is listening to the port...
    Hope this helps you a bit...

  • Any way to communicate with Serial PORT using JavaScript

    is there any way to communicate with Serial PORT using JavaScript ??
    Dont tell me to do it in java because I need to this on client side not on server side.
    such as when client pressed the button, a javascript function will be called and in that function I need to communicate with the serial port of that client... That action will not go to server side.

    Is there any way to send a string of bytes to the serial port from the client side ?
    Just a button on the web page that sends out stuff to the comport.
    I was hoping to do this using java script also ..

  • How to detect if my external device is connected to the Serial port

    Hi,
    If I remove the cable from the serial port in my pc or either remove the serial cable from my external device, then when I send a request to open the serial port from my program, it basically does nothing, it just sits there.
    I want to be able to show some sort of message or any other way of indicating to the user that they should check the cable.
    below is the bit of code to open and set serial port params:
         public void openPort() {
              // Initialise the drivers
              System.setSecurityManager(null);
              String driverName = "com.sun.comm.Win32Driver";
              try {
                   CommDriver commdriver = (CommDriver) Class.forName(driverName)
                             .newInstance();
                   commdriver.initialize();
              } catch (Exception e2) {
                   e2.printStackTrace();
              // port will be set in Store Operations.
              String wantedPortName = Configuration
                        .getParameter(ConfigSetting.EFT_COM_PORT);
              //System.out.println("wantedPortname : " + wantedPortName);
              Enumeration portIdentifiers = CommPortIdentifier.getPortIdentifiers();
              CommPortIdentifier portId = null; // will be set if port found
              while (portIdentifiers.hasMoreElements()) {
                   System.out.println("counter");
                   CommPortIdentifier pid = (CommPortIdentifier) portIdentifiers
                             .nextElement();
                   System.out.println(pid.getName());
                   if (pid.getPortType() == CommPortIdentifier.PORT_SERIAL
                             && pid.getName().equals(wantedPortName)) {
                        portId = pid;
                        System.out.println("found a macth");
                        break;
              } // end of while
              if (portId == null) {
                   System.err.println("Could not find serial port " + wantedPortName);
                   //System.exit(1);
              try {
                   port = (SerialPort) portId.open("EFTDriver", // Name of the
                                                                               // application
                                                                               // asking for the
                                                                               // port
                             10000 // Wait max. 10 sec. to acquire port
              } catch (PortInUseException e) {
                   e.printStackTrace();
                   System.err.println("Port already in use: " + e);
                   //System.exit(1);
              // Now we are granted exclusive access to the particular serial
              // port. We can configure it and obtain input and output streams.
              try {
                        port.setSerialPortParams(9600, SerialPort.DATABITS_8,
                             SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
              } catch (UnsupportedCommOperationException usc) {
                   System.err.println("Unsupported operation" + usc);
              }Please advise what method can I use for this purpose.
    Thanks
    Abhi

    You mean it hangs in the open() method despite the timeout?

  • Access serial port through AIR

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

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

Maybe you are looking for

  • What is use of INCLUDE in command line statement?

    Pls. explain following line. How this works and what is expected output for this line. /: INCLUDE &VBDKA-ZTERM& OBJECT TEXT ID SDTP PARAGRAPH L Thanks Harshada

  • How to set imgae/photo size in a OLE word

    Hi, I am developing a OLE object to extract data from SAP system into a MS Office word documnet. I am downloading image from application server to presentation server and displaying it on word documnet using create object g_wordobj 'Word.Basic' . cal

  • Acme Video

    I was looking at the sample video rental application that comes with JDeveloper 2.0 and I had a question about the OAS part: each transaction starts a thread that handles the session's expiration but as far as I know, the JWeb cartridge doesn't let t

  • Cost Centre Reports

    Hi Team, We are in process upgrade from Ecc 5.0 to Ecc 6.0. When i generate cost centre reports i am getting below error, can any body guide on this "Report 1-SIP 001 Does not contain any data pages".  Actual so many entries were there in cost centre

  • Alert Messege!

    Hi All,                I have a senerio. My landscape is R/3 - > XI ->  FTP Server ->  SAP POS Triversity. Data ones moved out of XI gets stored in FTP server, on daily basis . Files from  FTP servers are picked up by SAP  POS Triversity.Files remain