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

Similar Messages

  • Can't down load programs it keeps showing old email address when new one has been verified

    Any suggestion on how to correct this concern still show old email address when trying to down load update apps new one has been verified. I can't do updates

    Go here > Apple - My Apple ID

  • How to read serial port and substring

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

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

  • "how to read serial port using labview 6.0"

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

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

  • How to install cs5 w/dvds when new computer has no drives?

    How do I install CS5 on my new computer that doesn't have cd/dvd drive, when my cs5 is on DVDs?  

    You must be on a trial download page to use the links, otherwise you get an error message.
    For example, load the following page: http://www.adobe.com/cfusion/tdrc/index.cfm?product=photoshop_elements&loc=us before pasting the link into the address bar.
    http://trials2.adobe.com/AdobeProducts/STVD/CS5/osx10/ProductionPremium_CS5_LS7.dmg

  • Out of the blue, my ITouch is unable to access my wireless network ONLY when my PC has been turned on (PC is connected via Ethernet cable, and has no wireless capability as far as I know).  What gives?  It works fine when the PC is off.

    Out of the blue, my ITouch is unable to access my wireless network ONLY when my PC is on (the PC is connected via Ethernet cable, and has no wireless capabilities that I know of).  What gives?  When the PC is turned off, everything is totally fine.  I\m stumped. 

    Does the iOS device connect to other networks?
    Does the iOS device see the network?
    Any error messages?
    Do other devices now connect?
    Did the iOS device connect before?
    Try the following to rule out a software problem:                 
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on your router
    .- Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - Wi-Fi: Unable to connect to an 802.11n Wi-Fi network       
    I suspect a problem with your router. Try changing the security. First use no security as a test.
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    If still problem and it does not connect to any networks make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar

  • How to get the exact time when condition records has been created?

    Hello All,
    Can anyone thorw some light on - how to find the exact time on which a particular condition record has been created?
    I have tried to get it from KONP {by inputting condition record number}, but unfortunately time is not tracked over there, but the date is tracked.
    Await your valuable inputs on the same.
    Regards,
    Hrishi

    Dear Hrishi,
    Try with this
    Go to display mode of the condition record through VK13 transaction from the condition record overview screen go to menu Environment >Changes>Click on Change report now system will take you to the Change Documents for conditions selection screen here you input proper selection data then execute now system will give the all the details here you can find the time also.
    I hope this will help you,
    Regards,
    Murali.

  • How to auto insert computed value when new data is created??

    I'm new to APEX and was trying to solve this:
    To make it simple: I have a table, square_table, with two fields: input_number and square_value.
    All I want to do is when a user enters an input_number from 'the form and report template', the squared value is automatically computed and saved along with the new number to the square_table.
    Would someone post a solution (as details as possible, pls :)? I have watched numerous tutorials and no luck.
    Many Thanks,

    Poor design. You should not do this, even for strictly educational purposes. Stick to 3NF as much as possible, and only denormalize if a)you REALLY REALLY REALLY need to do it, AND b)your denormalized design survives peer review, AND c)you document VERY WELL the rationale behind such a design. Please read this - look for "Calculated Values".
    Anyway. You could do this at least two ways:
    1) Create a Page Process in your APEX application. Not a good idea, as other sources of INSERTs (sqplus, client/server apps) will not do the calculation unless coded to do so, and doing so would create multiple points of maintenance and documentation and testing, no to mention the added complexity of dealing with several potential development environments; or
    2) Create a good old plain trigger.
    If this was not a flawed design, I'd go for (2). It is basic SQL homework, well documented and simple to implement.
    Regards,
    Georger
    user11288935 wrote:
    I'm new to APEX and was trying to solve this:
    To make it simple: I have a table, square_table, with two fields: input_number and square_value.
    All I want to do is when a user enters an input_number from 'the form and report template', the squared value is automatically computed and saved along with the new number to the square_table.
    Would someone post a solution (as details as possible, pls :)? I have watched numerous tutorials and no luck.
    Many Thanks,

  • Why do I get a boot drive not found error only when laptop lid has been closed?

    I've got a HP Mini 210 P/Number: VX818EA with Windows 7 Starter.
    It works fine when turning on after shutdown, but when I've put it to sleep by closing the lid it won't 'wake up', and I get a blank screen. On restarting the computer I get a 'boot drive not found' error, (3F0) which can be resolved by following the steps on this page: http://h10025.www1.hp.com/ewfrf/wc/document?docname=c01443463&tmp_task=solveCategory&lc=en&dlc=en&cc...
    I've run disk check etc as suggested on that link, no errors are found, but nothing seems to resolve the problem more than temporarily. Seems odd that this only happens if I close the lid (sleep mode with the lid up is fine, doesn't crash the computer).
    Can anyone advise?
    Thanks

    Hello,
     Very strange, can you go to BIOS and reset the setting " By Default " ?. How did you check the disk ?
    This is an unusual probleme Hp Mini 210 . And notice me after your reset the bios settings.

  • How to find out when a file has been written to ?

    Hello All,
    In an application I want to open up a file (while letting another process write to it). As stuff is getting written to the file I want to be able to process that data (getting close to real-time as possible). How would one go about finding out when new data has been written to the file ? Does Java provide some alerting mechanism for file changes ? Thanks in advance...
    -Pete

    Maybe you could keep tabs of the file size. If the file size grows (which it will do each time the writing process flushes that files output buffer), then the file was written to.
    What I'd like to know is if there is some way to monitor the entire drive for changes and respond to stuff like that. I know that the Win32 API provides services that monitor the file system for changes, but I don't know if other OS's do... or if Java provides an interface to those features.

  • How to refresh ViewObject from database when another user has changed data?

    Hello, I use oracle database server 9.0.2 and JDeveloper 9.0.3 and I am developing a JClient application. I have JTable which is bound to a certain view object based on one entity and this is shared between many users. If a user inserts or updates a row in the viewobject (using for example the table) and commits changes, another user can not see the the inserted row while the underlying viewobject executeQuery() call.
    What I need is to refresh data for all users if one of them inserts or updates date. Is it possible?
    What I was able to think of was to use timer and executeQuery in certain period of time. Is there any better way? I mean kind of event which is fired when underlaying data has been changed?
    Thank you in advance!

    So you're saying there is no way for a client application to receive notice from the database that a table has been updated? It seems like this would be a valuable feature, and in fact I could very much use such a feature right now.

  • I have set up another account with a different email which is not mine. AN email has been sent to this email to verify the account, how do i stop this being created?

    I have set up another itunes account by accident. I do not have access to this email as it must belong to someone else. An email verification to set up a new account has been sent to this email know. How do I stop this account from being created?

    To change accounts on your Mac, go to System Preferences, sign out of the current account, then sign into the new account.  When you sign out of the current account it will delete synced data from your Mac.  Assuming your data (such as contacts, calendars, etc.) is in the other iCloud account, it will be synced to your Mac when you sign into this account.

  • How can I save music that has been sent to me via email on my iPad.?

    How can I save music to my iPad that has been sent to me in an email? Please help

    You can't save it to the Music app directly on the iPad, you will need to see if there are any third-party music apps in the store that you allow you to copy music from Mail to them. For the Music app then only way to get music into it is via the iTunes store app directly on the iPad and by syncing from your computer's iTunes.

  • How to apply the constraint ONLY to new rows

    Hi, Gurus:
       I have one question as follows:
       We need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and  I should apply not null constraint to the columns . However, since legacy system already has data for every table, and old data does not have value for the 2 new columns. If we apply the constraint, all of existing rows will raise exception. I wonder if there is possibility to apply the constraint ONLY to new rows to come in future.
    Thanks.
    Sam

       We need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and  I should apply not null constraint to the columns .
    The best suggestion I can give you is that you make sure management documents the name of the person that came up with that hair-brained requirement so they can be sufficiently punished in the future for the tremendous waste of human and database resources they caused for which they got virtually NOTHING in return.
    I have seen many systems over the past 25+years that have added columns such as those: CREATED_DATE, CREATED_BY, MODIFIED_DATE, MODIFIED_BY.
    I have yet to see even ONE system where that information is actually useful for any real purpose. Many systems have application/schema users and those users can modify the data. Also, any DBA can modify the data and many of them can connect as the schema owner to do that.
    Many tables also get updated by other applications or bulk load processes and those processes use generic connections that can NOT be tied back to any particular system.
    The net result is that those columns will be populated by user names that are utterly useless for any auditing purposes.
    If a user is allowed to modify a table they are allowed to modify a table. If you want to track that you should implement a proper security strategy using Oracle's AUDIT functionality.
    Cluttering up ALL, or even many, of your tables with such columns is a TERRIBLE idea. Worse is adding triggers that server no other purpose but capture useless infomation but, because they are PL/SQL cause performance impacts just aggravates the total impact.
    It is certainly appropriate to be concerned about the security and auditability of your important data. But adding columns and triggers such as those proposed is NOT the proper solution to achieve that security.
    Before your organization makes such an idiotic decision you should propose that the same steps be taken before adding that functionality that you should take before the addition of ANY MAJOR structural or application changes:
    1. document the actual requirement
    2. document and justify the business reasons for that requirement
    3. perform testing that shows the impact of that requirement on the production system
    4. determine the resource cost (people, storage, etc) of implementing that requirement
    5. demonstrate how that information will actually be used EFFECTIVELY for some business purpose
    As regards items #1 and #2 above the requirement should be stated in terms of the PROBLEM to be solved, not some preconceived notion of the solution that should be used.
    Your org should also talk to other orgs or other depts in your same org that have used your proposed solution and find out how useful it has been for them. If you do this research you will likely find that it hasn't met their needs at all.
    And in your own org there are likely some applications with tables that already have such columns. Has anyone there EVER used those columns and found them invaluable for identifying and resolving any actual problem?
    If you can't use them and their data for some important process why add them to begin with?
    IMHO it is a total waste of time and resources to add such columns to ALL of your tables. Any such approach to auditing or security should, at most, be limited to those tables with key data that needs to be protected and only then when you cannot implement the proper 'best practices' auditing.
    A migration is difficult enough without adding useless additional requirements like those. You have FAR more important things you can do with the resources you have available:
    1. Capture ALL DDL for the existing system into a version control system
    2. Train your developers on using the version control system
    3. Determining the proper configuration of the new server and system. It is almost a CERTAINTY that settings will get changed and performance will suffer even though you don't think you have changed anything at all.
    4. Validating that the data has been migrated successfully. That can involve extensive querying and comparison to make sure data has not been altered during the migration. The process of validating a SINGLE TABLE is more difficult if the table structures are not the same. And they won't be if you add two columns to every table; every single query you do will have to specify the columns by name in order to EXCLUDE your two new columns.
    5. Validating the performance of the app on the new system. There WILL BE problems where things don't work like they used to. You need to find those problems and fix them
    6. Capturing the proper statistics after the data has been migrated and all of the indexes have been rebuilt.
    7. Capturing the new execution plans to use a a baseline for when things go wrong in the future.
    If it is worth doing it is worth doing right.

  • TS1550 Back up to time machine failed.  Error, "Files can't be copied onto the backup disk because it appears to be read-only". Back up has been working.  drive is not read only.  How do I fix this?

    Back up to time machine failed.  Error, "Files can’t be copied onto the backup disk because it appears to be read-only". Back up has been working.  drive is not read only.  How do I fix this?

    Hello,
    http://pondini.org/TM/C6.html

Maybe you are looking for

  • Unable to launch application with java web start (OILOM)

    I'm connecting to a remote Oracle console from a server, using "oracle integrated lights out manager". I go to "Remote Control" and click on "Launch Console". After that, it download a JNLP file, called "jnlpgenerator-16". I open it with Java7 -web s

  • NON RECEIPT OF FREE GIFT

    RESPECTED SIR!                              I HAD PURCHASED A LAPTOP HP PAVILION MODEL DV6910TX SRL NO. CNF8313WOB ON 28 NOV 2008 FROM M/S JAIN INFOSYS PRIVATE LTD. GUWAHATI ASSAM AND SEND A DRAFT OF RS 990/- FOR THE FREE GIFT I.E. 8 MEGA PIXEL KPDAK

  • How to install the form server?

    if i want to install the form server,did i need intall the oracle as10r2 database first? after I have installed the form and report service successful, I need apply the Oracle AS10gR2 Patch Set 3 (10.1.2.3),but I got an error that 'there are no patch

  • Local network computer name keeps changing

    I haven't been able to work out why my iMac has bouts of telling me that my computer's name is already in use on the network and adding a number to it. I keep having to go into System Preferences/Sharing and change it back again so that my husband ca

  • Set of unique controls within array

    Is it possible to get a set of unique, individual controls with different ranges within an array of controls? This is not the default operation. For example, I'm using Analog Output VI with Fieldpoint AO module. I have distinct scaling on each channe