Serial port indicator

I have the output of the serial port wired to an indicator and it's configured to display in hexidecimal format. (The output string is converted to an array of uint8 first.) I want to the indicator to maintain the value of the last number it received from the serial port. Currently the indicator resets to zero when nothing is being received over the serial port. How can I change this behavior so that the value is only updated when new data is received from the serial port. Thanks for any help.
Solved!
Go to Solution.

Place a Case Statement that triggers a refresh of the indication only when Bytes at Port is Greater Than 0 (zero).
And, of course, place the indicator inside the TRUE case of the Case Statement.
What you can do is wire the output (numeric) of the Bytes at Port directly to the Case Statement.  Make the '1' case default.  You can also use that same case to read the port, thus display the last set of data.  Of course, you can have two wires, one that keeps all of the data that was read (shift register), and the other wire parses the portion that you want to keep in the display, and you wire that output to your indicator.

Similar Messages

  • How do I process serial port strings as bits

    In response to my commands, my instrument is sending bytes to my serial
    port. In one instance, 2 bytes are received. I want to treat these 2 bytes
    as a group of 16 bits.
    The VISA and Compatibility Serial functions return these bytes from the
    serial port to Labview clearly labelled a "string".
    Everything I can find in the way of Labview functions and .vis don't want to
    do bit twiddling, bit swapping, and bit dropping, with "string" data.
    I thought "hex string to number" could be used here, but I can't find a way.
    The 2 Bytes in question can be represented as hex, but the data are not the
    ASCII codes for the hex representation of a binary number, they are the
    binary number. This "hex string to number" seems to want ASCII c
    odes.
    You can feed a hex number typed into a "control" box wired into "hex string
    to number" and you get a meaningful number. You can feed the 2 bytes from
    the serial port into an "indicator" set to read in hex and you get a hex
    number that is a correct representation. But that is Labview handing them
    around to itself. I need to get my "hands" on them.
    I can't feed those same bytes that show up as a correct hex representation
    in an indicator into the "hex string to number" or anything else, so far,
    and get a number that is useful for further processing.
    I thought "variant to data", but I can't find enough reference material to
    understand how to use it. A boolean array seems like a bit of a weird
    approach, so I thought I'd ask before I looked into that.
    I'm used to dealing directly with binary numbers on the processor stack, I
    call them whatever I want, and turn them into anything I feel like.
    I'm sure I'm staring the solution in the face, but I can't find any way to
    persuade
    Labview to treat this "string" data as 16 bits.
    I've got the 16 bits, which is better than not having them, but I don't have
    much hair left.

    duh, well I finally discovered the "Unflatten from String" function. A guy
    just feeds in the bytes he's collected from his serial port that Labview
    thinks are a "string", and out come lovely little unsigned 16 bit numbers,
    or whatever other type of number he wants to turn the bytes into. And there
    are great little bit twiddlers available after that, like "swap bytes", and
    you can mask out bits with the logic operators, why this is fun. There's
    nothing like being a moron...... fly me to the moon...................
    "David Lewis" wrote in message
    news:[email protected]..
    > The two bytes would come from a serial port read.vi in Labview, classed as
    a
    > string. For instance, D3 and 02. The output wou
    ld swap the two bytes,
    i.e.
    > to 02 and D3, consider the two swapped bytes as 16 bits, drop the six most
    > significant bits, and output the ten bits that are left as an integer
    > classed by Labview as some kind of number, not a string.
    >
    > Your example StringToBits_Converter.vi I found on the ni.com site
    > unfortunately gives an error message and refuses to open on my system
    saying
    > it comes from a newer version of Labview 6 than I am running. Mine says
    > 6.0.1b3. Thank you very much anyway.
    >
    > "FightOnSCTrojan" wrote in message
    > news:[email protected]..
    > > In another words, you want to create a VI in which the input is 2
    > > strings (i.e. AB) and the output is the converted array bits (e.g.
    > > 1010101010101010)?
    >
    >

  • Problem --serial port reading one character at a time

    Hi Friend,
    I reading the serial port  one character at a time ,  i specified it in the "serial bytes to read" option in serial port read examples.
    The problem is ----------i can able to read  the data.
    but only the first character is reading again and again...and "reading string indicator" in the serial port example shows only the first character sent ..only for a single time.since i am reading continously ----aleast the first character should display as many times i running the program
    (i am running the vi by run continous option..........)..
    please help me ....how to read the character one by one.....
    regards
    rajasekar

    Hi jason...
    I can able to read the serial port by 1 byte or 2 byte or 4 byte as i can specify it in the serial port read bytes option..(in visa serial read)..
    I need to acquire 4 bytes of data and pass it to the Math-script node..and save these 4bytes of data in array (1 row and 4 column)..
    And split this array(just like array-indexing.vi) and processing it each each column separately....
    or suggest some method to achieve my task.....please.
    one more thing the math-script node is placed in a while loop.....in order to read sequence of bytes continously.......
    regards
    rajasekar

  • Serial port: Input/output signal errantly combined

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

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

  • MEASURING FORCE ON BALANCE USING AN ELECTRONIC BALANCE FROM THE SERIAL PORT

    Hi,
    I am trying to measure FORCE using an electronic BALANCE from the serial port. My measurements are strange! The BALANCE sometimes give ZERO reading! Is it because of the sample rate, baud rate etc? I have attached the readings concerned.
    Attachments:
    databalance.doc ‏144 KB

    I think your problem is due to the way you read the weight :
    1/ask the balance to send the data
    2/oversee the byte number on the serial port until it is constant
    3/read the bytes received
    4/convert to number
    During step 2, you compare the bytes at serial port with the previous value. So far, you have been very lucky to be able to read something : the answer here is always ZERO since the readings occur BEFORE the balance has been able to send anything! means that your loop stops immediately (if you are not convinced, jujst add an indicator to display the loop index. However, since you added a wait (0.8 s), when going to step 3, the balance has had some time to send something. Here, you should not have read again the number of bytes at serial port, but that unwillingly corrects the previous error and you can read most of the received data...
    You should modify completely your algorithm. Usually, a balance send the weight as a string with some terminator (RC or LF). Accordingly, the algorithm should be :
    1/ask the balance to send the data
    2/read the serial port, concatenating the received chars until a terminator char is received or a timeout has occured
    3/convert to number
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • N95, Bluesoleil = serial port service

    N95 firmware 10.0.018
    Bluesoleil v2.3
    PC Suite 6.81.13
    Is Bluetooth serial port service available for N95?
    I tried to use serial port service in Bluesoleil 2.3 but only dial-up networking, object push and file transfer services are available. SPP is not.
    On the other hand, when synchronizing contacts and calendar with Outlook by using PC Suite, I can clearly see in Bluesoleil panel that serial connection service is established (icon turns green in Bluesoleil indicating service in use). Bluesoleil pops a balloon messages
    * My Bluetooth COM port 15 (COM15) is connected to remote device.
    * Connected (COM15)
    So, service is available from N95, but I can not use it from Bluesoleil alone?
    Is there a way to use serial port in applications other than PC Suite?

    I updated firmware to 12.0.013, and the problem is still here.
    Does anyone have any idea?

  • Unable to Open Serial Port

    Hi I am trying to write to an ADAM 4571 Ethernet to RS422 converter. Using the software provided by the vendor Ver. 1.49. I can setup the device properly, than configure it as a virtual com port. The problem is LabView sees the port but can not open it. Visa Open Fails every time. There is very little information about this problem.
    Thanks,

    Hey Thanks for replying so fast. I know the error code would be helpful, but I don't have access to the equipment at this time. Let me tell you a little more history; Two different computers one is a laptop, has the runtime LabView 11 SP1, NIDAQ951f1_downloader and niser370 installed.  This machine the software works as it should running an executable. The second computer has LabView 11 SP1 Developer installed. This is the development station, this machine is the one that I can not open the Virtual com port. Vender software is installed on both machines and configured the same. The executable source code will not run on the development computer. It fails when it tries to talk to the serial port. To trouble shoot this problem I opened a blank VI dropped Visa Open and Visa Close in it wired a control to Comport selection and indicator to error out, connected error terminals and com out to com in. The error said that it could see the com port but could not talk to it. This error was generated by the open routine.

  • Serial port writing return different in MAX and Labview

    Dear all,
    I have a very strange problem here. I had a device connected to the serial port, which can be started by sending "start\n".
    Firstly, I used the IO in MAX to send "start\n", like the first figure, and the device operated correctly.
    Then, I initialized the device, and used the program in the second figure, to write the same "start\n", but this time the device operated wrong.
    I think the serial port setting are the same, and the device is not failed (after the second step, I repeated using MAX and still it's OK).
    Could anyone to check what's wrong here?
    Many thanks!

    In your LabVIEW code, how do you know that it did not work?
    Did you receive and error on the error indicator?  You don't have any VISA Read going on, so you aren't trying to read the response.

  • How do I monitor serial port activity without first sending a command?

    In my application I am sending a command through the serial interface and I want to monitor the response. The response is not instant, in fact it is a timeout response indicating the requested action did not work. How do I monitor so I can parse what is coming in over the serial port without necessarily sending a command?

    You can always place a loop where you monitor the number of bytes at the serial port.
    After configuring your VISA serial port session, you can create a Property Node to get the number of bytes available at serial port.
    You can then process this information, for instance:
    1. Establish a timeout because you never get a response.
    2. Do serial port read if there is data available.
    You can exit the loop with a timeout condition or having processed the data.
    -JLV-

  • Serial port not reading after few seconds PLZ HELP...

    Hi,
    I have developed a GUI using Swing in NetBeans IDE 4.0 on Windows 2000 professional for one of our products.
    It communicates with the associated Hardware through serial port.
    The GUI sends commands to the H/W to perform some functionality. After receiving response from the H/W, GUI displays the necessary messages.
    Since the H/W does require some time to perform the indicated operation, it sends the response after 10-11 seconds but my GUI is not reading the response.
    Both the command and response are single byte (8 bits) wide.
    The GUI can read the response if sent within 3-4 sec.s but not after that.
    I have disabled the Receive TimeOut on the serial Port.
    Following is the code I use to Open and use the SerialPort.
    public void OpenPort(){
             portList = javax.comm.CommPortIdentifier.getPortIdentifiers();
            while (portList.hasMoreElements()) {
                portId = (javax.comm.CommPortIdentifier) portList.nextElement();
                if (portId.getPortType() == javax.comm.CommPortIdentifier.PORT_SERIAL) {
                    if (portId.getName().equals(Welcome.CommPort)) {
                        try {
                            serialPort =  (javax.comm.SerialPort)portId.open("FCAT-01 ATE", 20000);
                        } catch (javax.comm.PortInUseException e) {}
                        try{
                            serialPort.addEventListener(this);
                        }catch (java.util.TooManyListenersException e){}
                            serialPort.notifyOnDataAvailable(true);
                   try {
                            outputStream = serialPort.getOutputStream();
                        } catch (java.io.IOException e) {}
                            try {
                                inputStream=serialPort.getInputStream();
                            }catch (java.io.IOException e){}
                                serialPort.notifyOnDataAvailable(true);
                   try {
                            serialPort.setSerialPortParams(Welcome.Speed, javax.comm.SerialPort.DATABITS_8, javax.comm.SerialPort.STOPBITS_1,
                                javax.comm.SerialPort.PARITY_NONE);
                        } catch (javax.comm.UnsupportedCommOperationException e) {}
                             serialPort.disableReceiveTimeout();
           Pls help me how to solve this problem as its really very urgently necessary to release the product.
    Thank u for ur time and consideration,
    Umesh Balikai

    Sir,
    Here is the complete code.
    The H/W takes about 10 seconds to reply. The GUI is responding to first response from ATE H/W and not to the subsequent ones. The ATE responds after the GUI sends command when the user clicks OKButton.
    package my.ate.pkg;
    import javax.swing.*;
    import java.util.*;
    public class PingTest extends javax.swing.JFrame implements javax.comm.SerialPortEventListener{
        /** Creates new form PingTest */
        public PingTest() {
            initComponents();
        private void initComponents() {                         
            // create and initialise  various buttons, labels, etc.
        private void OKButtonMouseClicked(java.awt.event.MouseEvent evt) {                                     
            // TODO add your handling code here:
            OKClick();
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new PingTest().setVisible(true);
        // Variables declaration                     
        private javax.swing.JLabel AN;
        private javax.swing.JButton OKButton;
        public static java.io.OutputStream outputStream;
        public static java.io.InputStream inputStream;
        public static java.util.Enumeration portList;
        public static javax.comm.CommPortIdentifier portId;
        public static javax.comm.CommPort commPort;
        public static javax.comm.SerialPort serialPort;
        public static byte[] readBuffer=new byte[20];
        public static int numBytes=0;
        private java.awt.Color Fail=java.awt.Color.red;
        private java.awt.Color Pass=java.awt.Color.blue;
        public static int requestCommand;
        public static int receiveCount=0;
        public static boolean portOpen=false;
      // End of variables declaration 
        public void serialEvent(javax.comm.SerialPortEvent event){
                switch(event.getEventType()){
                    case javax.comm.SerialPortEvent.BI:
                    case javax.comm.SerialPortEvent.OE:
                    case javax.comm.SerialPortEvent.FE:
                    case javax.comm.SerialPortEvent.PE:
                    case javax.comm.SerialPortEvent.CD:
                    case javax.comm.SerialPortEvent.CTS:
                    case javax.comm.SerialPortEvent.DSR:
                    case javax.comm.SerialPortEvent.RI:
                    case javax.comm.SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                         break;
                    case javax.comm.SerialPortEvent.DATA_AVAILABLE:   
                        try{
                                 numBytes=inputStream.read(); 
                                     if(numBytes==0x54)  {
                                        // display some message
                     else if(numBytes==0x41)  {
                                        // display some message
                                    else if(numBytes==0x46)  {
                                         // display some message
                      else if(numBytes==0x42)  {
                                             // display some message
                        }catch (java.io.IOException e){}
                        break;
        public void OKClick(){
            if(portOpen){
                        serialPort.close();
                        portOpen=false;
            OpenPort();
            try{
               Thread.sleep(500);
            }catch(java.lang.InterruptedException e){//display error}
            try{
                outputStream.write(0x39);
            }catch(java.io.IOException e){//display error}
            //display some Progress Message
        public void OpenPort(){
             portList = javax.comm.CommPortIdentifier.getPortIdentifiers();
            while (portList.hasMoreElements()) {
                portId = (javax.comm.CommPortIdentifier) portList.nextElement();
                if (portId.getPortType() == avax.comm.CommPortIdentifier.PORT_SERIAL) {
                    if (portId.getName().equals(Welcome.CommPort)) {
                        try {
    serialPort =  (javax.comm.SerialPort)portId.open("FCAT-01ATE",2000);
                                           } catch (javax.comm.PortInUseException e) { //display error}
                        portOpen=true;
                        serialPort.notifyOnDataAvailable(true);
                        try{
                            serialPort.addEventListener(this);
                        }catch (java.util.TooManyListenersException e){ //display erro}
                        serialPort.disableReceiveTimeout();
         try {
                            outputStream = serialPort.getOutputStream();
                        } catch (java.io.IOException e) { //display erro}
                            try {
                                inputStream=serialPort.getInputStream();
                            }catch (java.io.IOException e){ //display erro}
                                serialPort.notifyOnDataAvailable(true);
         try {
                            serialPort.setSerialPortParams(Welcome.Speed, javax.comm.SerialPort.DATABITS_8, javax.comm.SerialPort.STOPBITS_1,
                                javax.comm.SerialPort.PARITY_NONE);
                        } catch (javax.comm.UnsupportedCommOperationException e) { //display erro}
    }Probably the command after clicking OKButton is not reaching the H/W. because the ATE will surely respond if it receives the command and that is tested several times.
    Thanks.

  • A problem about reading from serial port

    Hi,
       I just sent '0x03' from MCU to PC continuously, and then sent  '/n' as a stop character after every '0x03'. I use labview to read the data. The problem is when it get two '03' it get a '0', another two '03' and another a '0'. I don't know where is the '0' from?
      PS: Hyper terminal can display natrually.
       Thank you! 
    帖子被hengfo在08-08-2007 10:14 PM时编辑过了
    Attachments:
    serial read.vi ‏36 KB

    I think the problem may be the loop reading the serial port is running too fast.  There is no timing delay in the loop, so you are reading it as fast as you can, and probably faster than the device is sending data.  So sometimes the buffer is empty, and then the empty string gets converted to a numeric zero.  The way to know for sure is to put an indicator on the error wire coming out of the serial port read.  I bet you will see errors about the read buffer being empty.
    Put a wait timer in the loop to slow down the execution just slightly.  This is a good idea so that LV doesn't eat up all the CPU resources.  Look at the example for Basic Serial Write and Read.  You may want to have a loop ahead of the read that waits until there are a certain number of bytes at the port before it reads the serial port.  You may want to put a loop around the serial port that waits until a valid number is read in before it exits the loop and goes to the numeric conversion.
    Message Edited by Ravens Fan on 08-09-2007 08:50 AM

  • Writing bytes out of Serial Port

    I'm trying to write an array of numeric (U8) bytes out of the serial
    port. The serial routines though only support strings. Labview has a
    routine which converts U8 into strings but only upto x7F (which is the
    limit of ASCII) and not to xFF.
    Anybody have a workaround to this ?
    Thanks.

    I just tried the "byte array to string" function (under "conversion"
    subpalette under "string" subpalette) and did not see this limitation.
    You can put an array of U8 on the front panel, change the format to
    display Hex, and type any hex code 0 to FF, and send this thru "byte array
    to string" and then through "string to byte arry" to get the original
    array back. Create an indicator for viewing the intermediate string and
    pop up on the string indicator to change it to hex display. You will see
    all the "characters" being translated faithfully.
    - Vinny Recca
    Ashish Khanna wrote:
    > I'm trying to write an array of numeric (U8) bytes out of the serial
    > port. The serial routines though only support strings. Labview has a
    > routine which converts U8 into strings but
    only upto x7F (which is the
    > limit of ASCII) and not to xFF.
    >
    > Anybody have a workaround to this ?
    > Thanks.

  • Serial Port and MSC1200

    Hello, I´m tried connect the serail port at MSC1200 microcontroller. The program performed perfect, but no message is show in string variable.
    Anybody know works with any project like this?
    Attachments:
    programa.JPG ‏60 KB

    I guess it's not perfect if you don't get any data.
    You have an indicator for number of bytes read. Is it greater than 0? If it's not, then the reason the string is empty is because there was nothing in the serial port buffer to read. Is the micro constantly sending out data? Have you tried using Hyperterminal to read the micro. If it is constantly transmitting, then the Hyperterminal scree will just fill up as long as you are connected. If the micro requires you to first send a command to request data, then you need to do a VISA Write of that command before doing the read.

  • Problems reading the serial port with labview 5.1.

    I open the example serial.vi , I select write to serial port, run the programm, I don`t have any problem. But when I select read serial port, I get the error code 16392and hex code error x4008. I need to know what can I do? Thanks a lot

    Any time you get an error in LV you can right click on the error cluster indicator and do a "Explain Error".
    If you do this for the error code you reported, the explanation says that it was a framing error.
    In serial communications, a framing error indicates that the hardware was not able to detect a start bit, data then the stop bits that comprise a frame.
    This prompts me to suggest that you check you port setting on the serial port. You want to make sure you are setting the port for the correct;
    Number of start/stop bits,
    Baud rate
    data bits
    parity (just for good measure)
    and hardware handshaking.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Serial port snooper

    I frequently have to do Serial or VISA comms with devices.
    I would like to know if anyone has any ideas for creating a VI that runs seperate to an existing VISA session which would "snoop" the (serial/GPIB) VISA port and read traffic going to and from the PC Port, without affecting the operation of the port.
    1) Is this possible to do this in LabVIEW - if the Comms to the device is also running in LabVIEW?
    2) Is it possible without extra hardware?
    3) Am I just being a wishful thinker? (it's the Mech Eng talking here)
    (I don't want to have to use any other propreitory S\W, I just want to see the history of the port commands, see the real time commands and possibly log them to a file)
    Cheers
    James

    I don't see why it could not be implemented in LabVIEW.
    If you have access to the original code that communicates over the serial port and you want to "snoop" into..  Then create an ActionEngine.  Call one copy WRITE-COM.vi and the other READ-COM.vi.  Drop it everywhere in the original code where you write to the port and the other everywhere you read and you can log everything that is "attempted" to write and everything that is read in seperate string buffers.  The ActionEngine would of course have two inputs, the state and the string.  You can do whatever you like within the AE, such as display to string indicator or write to file (or both).
    Now the only limitation is that you cannot see what is going over the physical serial cable.  That would be the same limitation from using any software solution.

Maybe you are looking for