Not correctly reading serial port data after first cycle

I set up a VI for serial communication using RS232 with a pressure transducer meter. The pressure readings are in a loop along with a series of calculations in that loop. The readout from the first cycle is correct, but i just see garbage characters on every subsequent cycle. The VI was running fine when the loop was just reading the pressure data and not performing any calculations. What could be the reason for this discrepancy.
The OS is windows NT and software is Labview 6.1
Thanks

Thanks for your response,
I am using a VISA. The bytes at serial port are fixed, that is for a particular command the response number of bytes is fixed. The read operation in the first cycle (of a loop) is correct but it reads garbage characters for every other cycle. I am using a 9600 baud rate and the meter responds directly in strings, no handshake is used.
Thanks for the response,
PS: The computer with the code is not connected to the net, i will need to transfer it to post the code.

Similar Messages

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

  • I have a case number but have not received my serial number yet after 4 days. Please help.

    I have a case number but have not received my serial number yet after 4 days. Please help.

    Do you know where I go to do contact Adobe directly, please?
    On Tue, May 5, 2015 at 11:06 AM, Barbara B. <[email protected]>

  • Read Serial port @100 us

    Hi guys,
    I'd like to know if Labview can read serial port @ 100 microseconds?
    Is it necessary any specific HW for  that? What HW can I use to read at that rate?
    Regards
    Kito

    Take 5-10 minutes and explain your problem much better. Like this. I have an instrument xyz. This instrument use a ZZZ communication protocol, over a YYY link. In my Labview program I want to achieve this XXX. This is what I have done so far.
    Remember good questions draw good answers.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

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

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

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

  • Video creation date not correctly read?

    This might be a bug--it appears to me that Bridge is not reading the EXIF "date/time original" field for avi files--instead it is reading the MS windows dates which is a bad thing because any time you copy a file, these dates get changed. Even just moving a video file to another hard disk will destroy the MS windows "creation date". However the EXIF dates are untouched.
    I'm using exiftool to read the metadata.
    Bart

    iPhoto uses EXIF metadata for it's creation date and videos do not have that metadata.  You can use the Photos ➙ Adjust Date and Time.... menu option to change the date to whatever you need to get it to sort in the right order when sorted by Date.
    OT

  • Occasional freeze when reading serial port

    I've a labview application which is a gui for a remote device via RS422.  The host computer is a quad core running XP SP3.  Initially I was developing with labview 7.1.1.  At random intervals (anywhere between 10 minutes and 5 hours observed), labview will freeze.  Using a port monitor during this freeze, I'm able to observe repeating calls for IOCTL_SERIAL_GET_COMM_STATUS followed by IRP_MJ_READ.  VISA is configured for 0.5s timeout.  The serial card is a MOXA, CP-114EL (4port RS422).  During the freeze, Labview cannot be closed.  Sometimes it will try by displaying the "Resetting..." text but it never completes.  A hard reset is then required.  After the freeze, processor usage is 25% (on average, 1 processor working full time for labview, but bouncing between cores).  Before the freeze, its less than 2%.
    At first I investigated the serial card driver via emails with MOXA.  After running a terminal emulation program and a loopback connector they gave me for several days without their program freezing, they're confident the problem isn't with their card or driver.  During discussions with them, I installed the evaluation of LabVIEW 2009.  The program still freezes except now I have less access to the VI (I used to be able to switch to the block diagram and via the highlighter tool observe it stuck in the read operation.  In either version though, the above mentioned port monitor output is the same.
    My instinct is that the source of the problem is in the multi-core application, some kind of timeout race condition.  My VI is fairly simple in summary, write a command (read temps, read status, write new params, etc) and wait for reply timing out if there's a problem.  Repeat.  Serial port is configured for 115kbps and transfers are in binary.  Before the freeze, the communication works well.
    I appreciate any suggestions.  I've looked around the net and this forum and didn't find anything similar.  Long time reader, first time poster.  I've a lot of experience in labview but can't solve this - the random interval doesn't help.  I think I'll start logging all serial transfers and see if anything always occurs before the freezing.

    This morning I updated the labview drivers to the most recent online (I hadn't done that yet when I installed LV2009, download was large).  It was something I planned to try if the LV2009 change alone did not resolve things.  The update also did not solve the serial freezing problem.
    I've attached two captures from NI Spy, one during normal operation and one of the last capture (up to the arrow).  I did a brief probing of a different VI that isn't a part of this afterward.  You can see the Read request of Com 2 for 266 bytes.  In the before image, red lines are timeouts.  So this read request is hung up waiting for bytes and never timing out.  That's at least my interpretation.
    I appreciate your and tbob's suggestions.  I've a new serial card (Brainboxes PX-310 card) to try coming soon, not that I don't want to solve this, I just can't spend too much time on it.  If it still gets hung up on the new card, I'll look into the motherboard PCIe port, maybe a failing transaction.  I would've went with the NI card but I need electrical isolation and 8 ports is excessive.
    Attachments:
    NI Spy - before freeze.JPG ‏104 KB
    NI Spy - after freeze.JPG ‏108 KB

  • An error about reading serial port

    Hi,
      I have sent 5 bytes(for example: "0","2","F","1","/n") to serial port and used VISA Read. But I only can read 0.  The right result is in the second line of the read string window, The first line is void. Generally speaking, "02F1" should in the first line,then I can read them correctly. The following picture is the result.
      Thank you!
    帖子被hengfo在09-17-2007 03:57 AM时编辑过了
    Attachments:
    read string.JPG ‏6 KB

    Hello,
    you should add a flat sequence with some extra e.g. 50ms delays between the visa writes and reads, that helped us a lot.
    You should also specify a large enough buffer. And don't forget to send the terminating CR and LF.

  • Reading Serial Port?

    Sorry, I'm not sure if this thread is the same thing but is Java capable of reading in 15 pins RS-232 port data stream? If so, could some one please point me to a good place to start, such which classes shall I use? thanks

    Peter__Lawrey wrote:
    You are right serialization and serial ports have little to do with one another.
    You could start by looking at [http://java.sun.com/products/javacomm/]
    I couldn't find an obvious forum for serial ports either [http://www.google.co.uk/search?q=java+serial+api+forum]
    Thanks, Pete. Thanks, George. It seems like Sun is no longer supplying Javax comm development kits from that link. I take that all newer version of JDK are shipped with it?

  • Javacomm serial port created after JVM started

    Hello all,
    I am playing with bluetooth and Java for a project and have run into a brick wall.
    My bluetooth adaptor (USB) uses rfcomm to create a virtual serial port to my phone.
    After exhaustive searching, I have not been able to find a Java API for a usb bluetooth dongle that will do this so I am having to use Runtime.exec to shell the program that will create the connection.
    The device that is created is /dev/rfcomm0, and I have created a symlink from /dev/ttyS1 to this so JavaComm can see this as /dev/rfcomm0 is not considered valid (I only have one com port in my PC so ttyS1 does not normally exist).
    When Java is started, /dev/ttyS1 does not exist (using the javacom to access it throws a NoSuchPortException) - this is expected. The problem is once the port is created, I still get the same exception. I can confirm that the port has been created sucessfully as minicom is able to communicate with the phone.
    I have tried putting the javacomm code in a new class, and creating a new instance of this class once the port does exist, but this does not work. I have also used the enumerator to check all ports that are known and /dev/ttyS1 does not appear in the list.
    If i run the command to create the port in a console before starting java then everything works althought this is obviously not acceptable as a final solution.
    Does anyone have any thoughts / suggestions what might help fix this?
    Cheers,
    -Jeff

    Morning,
    don't try to get the JavaComm class loaded before the rfcomm process has finished.Unfortunatly the rfcomm process will not terminate whilst the port is open, which makes things much harder.
    Here are some code snippets, the connect method is called as soon as I start my java program. It starts a thread which invokes the rfcomm commands. If the process terminates immediatly (p.waitFor() only waits a moment) then the connection has not been made, and runState is set to -1 which terminates the while loop in connect() and returns false.
    If the connection is made sucessfully, the process doesn't terminate, so the only way for the connect() method to return is if validPort returns true.
    The portListener class is the only one that uses javax.comm, and each time I call it I create a new instance - which I presume would re-scan for avaliable serial ports.
    If the serial port is not avaliable, an exception is thrown, so it returns false, if no exception is thrown it returns true.
    BTDevice.java
    public boolean connect(String addr)
    runState = 0;
    address = addr;
    start();
    while (runState == 0)
    if ((pl = new PortListener(serialPort)).validPort())
    runState = 1;
    return runState == 1;
    public void run()
    String s="";
    try
    p = Runtime.getRuntime().exec("/usr/bin/rfcomm connect rfcomm0 " + address);
    p.waitFor();
    catch (Exception e){}
    runState = -1;
    PortListener.java
    public boolean validPort()
    try
    CommPortIdentifier.getPortIdentifier(serialPort);
    return true;
    catch (Exception e)
    return false;
    Unfortunatly this does not happen, and even once the connection is made, validPort still returns false, as a NoSuchPort exception is thrown.
    However, if I put in a Thread.sleep(60000); between the start() and while (...) in connect() - so the first time an instance of PortListener is created the port does definatly exist - everything is fine.
    This must mean that as soon as javax.comm is initialised for the first time within a JVM, it stores all the known ports etc. so any other time it is used (even within a new instance of a class) it uses what it found out the first time and doesn't scan for new ports.
    I do not want to leave in Thread.sleep(...) as the connection time can vary, if the phone is set to auto-connect it takes 2-3 seconds, if it isn't it can take 15 seconds before the user looks at the phone.
    Any thoughts on how to make it re-scan for avaliable ports?
    Cheers,
    -Jeff

  • "how to read serial port using labview 6.0"

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

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

  • Sampling Serial Port Data

    I am sampling data coming in via the serial port. The data is updated every second Displaying the one second data is fine, however I only want to store a record every fifth minute, how do I accomplish this without storing all the one second data?

    MacKensie,
    You would read the buffer much more often than every five minutes. Read the port every second when the data is received. Put the data in a shift register or other buffer. Keep only as much data as you will want to display or save and discard the older data.  This is called a circular buffer.
    If you only want to save the most recent data received, just keep only one point in the shift register.  When the 5 minute time has elapsed, save the point in the shift register, which should be the most recent point.
    Lynn

  • How to read serial port and substring

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

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

  • Error: File just captured could not be read and was deleted after capture.

    I was just recording an extremely important interview. I have recorded literally 10.000 recordings before with the same setup, every day, over a period of some three years now. I'm recorging DV PAL through SDI input on a AJA KONA LS card.
    It seemed to be going well last night while recording but as soon as I pressed 'Esc' to end the capture I got an error message saying (not exactly in these words) : Error: The file just captured could not be read.
    The file couldn't be found anywhere on the HD or in the trash. Usually when something goes wrong during capture, you can find the file in the capture folder named 'filename-av'. Not this time, I have never seen this error message before.
    The person being interviewed was absolutely furious and said he would not do the interview again. So I'm up against the wall here, and need to recover the files.
    What's more, the problem still persists. When I try capturing again, as soon as I stop the same error occurs. So now my FCP is not capturing anymore
    I tried running Data Rescue 3.1 and found the recording in deleted files, but:
    1. the recording is in several parts (not sure if it's all there, but probably most of it)
    2. Data Rescue 3 interprets the files as .dv files, as opposed to .mov files as all my other recorded material.
    3. THERE IS NO AUDIO IN THE .DV FILES, which pretty much nullifies the file recovery altogether.
    I tried googling this error, but it did not help much:
    1. None of the people were capturing the same way I do (most were capturing from tape, none straight through KONA SDI input)
    2. There was no solution to prevent the error.
    3. No solution to recover the files either.
    I must say, this experience really taught me the essence of Murphy's law: 'Anything that can go wrong, will go wrong at the worst possible moment'
    Any suggestions as to the reasons for this?
    Any suggestions as to how the files can be recovered?

    Good news!
    I beleive I have found the cause and solution.   At least now I am able to reproduce the problem at will and therefore, hopefully prevent it.
    I discovered that there is nothing wrong with my AJA KONA setup, as I was able to capture with both QuickTime movie capture and Adobe Premier just fine.  But every time I try capturing in FCP I get unreadable capture files (since 2 days ago).
    Trying all possible capture settings, capture presets or easy setups did nothing.  (although capturing thru Firewire still works every time).
    I was about to give up when I noticed that where I usually have my video scopes window running, for convenience sake, under it the Voiceover utility was running.
    So here is the deal:  Usually when you try and capture with the Voiceover utility running, you can't. FCP wont allow you to capture, it will return an error message saying: 'Log and capture can not be opened while Voice Over is running. Please close Voice Over and try again.'  As it turns out, this warning is probably for a good reason.
    BUT...
    If you shut down FCP with Voice Over running and start it up again THEN you CAN run Log and Capture at the same time... everything looks OK, until you stop the recordin, then you get an error message saying your recording is screwed.
    I tried this over and over again,  every time it behaves the same way.  Shutting down with VO util>starting up again>recordings get screwed  .. close VO utility>back to normal operation.
    I'm not sure if it was the VO utility the last time this happened (few weeks back), but it might very well be.  I might not have noticed that the VO utility was running as it was hidden behind the videoscopes and there are no warnings when running Log and Capture if you start up FCP with VO utility still running.
    My educated guess to what is going on is that the VO utility is taking up priority over the sound inputs and by doing so making the audio of the capture unreadable.  This theory is supported by the fact that when my data recovering experts found the recordings on the HD, there was no audio on the files, but the video was intact.
    The only reason setting up the AJA drivers helped in the past was probably because that flushed the FCP settings and in doing so closed the VO utility window. How very ironic
    Hope this helps someone out there. And I hope Apple find a way to prevent this from happening.
    cheers!
    Vidar F.

  • Variable Screen Does Not Display in Bex Web Analyzer after first time

    We recently upgraded from BW 3.1 to BW 7.0 (without upgrading specifically to 3.5).  We are having a problem with our Web Bex Analyzer not showing the variable screen although the variable screen is displayed successfully when running the same query from the Bex Analyzer.  Based on feedback from other posts regarding similar topics, we modified the 0analysis_pattern template to ensure that Display Variable Screen was checked on.  We are finding that when we open the Web Bex Analyzer and do a New Analysis, the first query we try to run will always have the variable screen displayed successfully.  Any susbsequent queries we try to run by clicking on New Analysis in that same open window will not show the variable screen and will start executing open ended.  This is occurring regardless of whether the query has mandatory or optional variables and we have confirmed that there is no personalization set for the variables being used.  We have tried it with several different queries and the results are consistent.  The first query you run shows the variable screen successfully and any queries run after that do not.  Any help in resolving this would be greatly appreciated as we have exhausted our resources researching and troubleshooting this problem.

    We did open an OSS note and heard back from SAP.  We made the recommended setting, see their response below, but as they stated, it will only show variable screens for queries that have at least one mandatory variable entry after the first query is opened. 
    Response from SAP: 
    Please check if the following setting is made within your template --
    In the 'Standard Actions' of the Web Template, do you have the setting
    'Action Before First Display' set to OPEN_VARIABLE_DIALOG
    The behaviour of the variable screen is different if you use mandatory
    variables and optional variables. If you have only optional variables,
    the Display Variable does not force the variable screen.
    Also, using the parameter VARIABLE_SCREEN=X only influences the
    web application at STARTUP. This would not come into affect when you
    use the 'New Analysis' button. This button resets the dataprovider so
    this would not affect the variable screen and would not redisplay the
    variable screen as you require.

Maybe you are looking for

  • Function Module to Read attributes value from Classification tab

    Dear Experts , We are using material classification in the material master. Under classification tab of material master , we are maintaining certain characteristics and their corresponding values. I want to read those values and use those in one of t

  • Can't Import java class in form 10g

    Hi All, I have tried to call a web service from oracle form 10g so, I read your available document (How to call Web service from Form 10g) http://www.oracle.com/technology/obe/obe_as_10g/deploy/callws_fromforms/forms_webservice.htm#r1 but when I've c

  • Dynamically creating multiple LineSeries from XML

    Hi, I'm unable to figure out why my chart does not display. My task is to read in an XML file, depending on which multiple line series will be created and displayed on a line chart. (I am using the Flex-Ajax Bridge) In my mxml, I have: [Bindable] pub

  • Badi Testing

    Hi All, I have written a BADI, but I am not sure about how to test the same. When i tried to debug the trasaction, i couldnt find the badi being triggered. does that need any project to be created ? Reagrds, Jhon

  • Why won't videos open and play?

    Using Safari, I try to open video from Facebook and other sites and they won't open or play. I can sometimes get them to load and play if I download them and open them in a separate window. Also, I have been opening them in Chrome and they all open a