How to make VI wait until data is saved before it can open and read data

I have developed two VIs for continuous monitoring. First VI is for acquiring raw strain data and saving it into a folder, let's say, every 10 minutes or every 100 Mbyte of data (for example, after monitoring for an hour, the folder will have 6 files, each of which contains 10 minutes of data). Second VI is for opening/reading/processing data files collected by the first VI.   Right now, this second VI can handle only one file at a time. What I am trying to do is to have this second VI open the files one after another automatically. Also (here is what I think will be difficult part), I want the second VI recognize that a file is saved by the first VI before opening it (i.e., wait until the first 10 minutes of data file is saved by first VI, open and process this first data, wait until the second 10 minutes of data file is saved by first VI, open this second file and process it, wait until the third 10 minutes of data file is saved by first VI, open and process it........). Any help or comments would be appreciated.
Thanks in advance for your help.
Brdg.

Basically, If your purpose is to keep one thread from opening the file until the DAQ thread has finished with it, then the queue is what I would use.
All functions are on the ADVANCED | SYNCHRONIZATION | QUEUE palette.
Use the OBTAIN QUEUE to create the queue. Set the DATA TYPE to a PATH constant. This creates a queue of paths.
Pass the QUEUE REFNUM to both the DAQ VI, and the PROCESSING vi.
In the DAQ VI, when you write a file, take the PATH from the CLOSE FILE function and use ENQUEUE ELEMENT to put it into the queue (use the refnum you passed in).
In the processing thread, use DEQUEUE ELEMENT to fetch the path from the queue. You probably should use a timeout value of 1000 mSec or so. If you timed out, go check your PROGRAM RUNNING flag (so you can stop without waiting forever on the queue), and if you're not stopped, try again.
If the DEQUEUE ELEMENT returns WITHOUT a timeout, then open the path it gives you - the file is guaranteed to be closed, since you closed it before you enqueued it.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com
Blog for (mostly LabVIEW) programmers: Tips And Tricks

Similar Messages

  • HT1146 microsoft Outlook for MAC, how can I set "receive notification email sent has been opened and read" in Outlook?  Thanks

    Microsoft Office for MAC, how does the sender select a notification that an email has been opened and read in Outlook?  Thanks

    Since this question is about a Microsoft product, you might have more luck getting suggestions if you ask in Microsoft's own forums.
    Regards.

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • How to make the exchange of data between 2 while loop in real time

    hello
    I have 2 while loop
    the 1st while loop includes the data acquisition program
    the 2nd while loop includes the control program
    my question is how to make the exchange of data between 2 while loop in real time
    I tried with the local variable and direct wiring between the 2 while loop
    it does not work (there is a delay)
    Solved!
    Go to Solution.

    Bilalus,
    Queues are only good to transfer data if your application isn't deterministic. Since you are using Real Time, I am assuming that your application requires determinism. If you are using Timed Loops and you use queues to transfer data between your loops, you are losing determinism. In this case, you need to use the RT FIFO functions. 
    Warm Regards,
    William Fernandez
    Applications Engineering
    National Instruments

  • How to make linkage query In Data Model for search

    I want to make an linkage query as a condition for my  report in BI Publisher. how to make the linkage in Date Model ?

    This is the forum for SQL Developer, not for general SQL or PL/SQL questions.
    Please repost this in the SQL and PL/SQL forum.

  • I have a line drawing (black on white paper) i have scanned and need to make the white paper transparent, maintaining the line drawing, can i and then HOW can i do this in PS?

    i have a line drawing (black on white paper) i have scanned and need to make the white paper transparent, maintaining the line drawing, can i and then HOW can i do this in PS? this is for my business logo. ive used it for years but with a solid background. id like to have it just be the drawing over my photos with a transparent background.

    First let me apologize for posting a reply that was only suitable for advanced users.  Photoshop is broad and powerful therefore has a huge learning curve.  In fact I would state no one knows and uses all of Photoshop.  When we first get Photoshop it intimidate us and we're very uncomfortable using it.  Many thing are not intuitive there in much learning involved.  After some time we begin to know something and we are able to do some thing.  Learning become rapid and we start playing in Photoshop.  It is very important to play with Photoshop.  Playing with Photoshop and asking for help with in forums like this IMO is the best way to learn. 
    Photoshop Power lies in layers, selection and automation.  However it takes knowledge to use photoshop well so most powerful tool you have ins Photoshop is the gray matter between your ears.  Most at one time or another want to watermark or put a logo on their image.  So its best to automate this process. All run into a problem in the process. "Size"  We find our assets vary in size and aspect ratios. Landscape, Portraits, Panoramas and others. This complicates automation.  Vector graphics works best when size vary greatly.  If you can not work out how to create a vector solution like a custom shape.  Create your Logo and watermark large thing scale down better the up. Text scale well for text uses vectors graphics however if you rasterize text it will not scale well.
    I do not type or do English well so let me do some screen captures.  I can not stress enough how important Black, White, Grays and Blending is when it come to image processing.  Become friends with Multiply, Screen, Overlay and Luminosity blending.....
    However when there is a white or black background though you can blend them you can not add a style like a drop shadow, emboss or make it invisible setting fill to 0 so only the style is visible.  When there is contrast between the logo and background it is easy to separate the two. To select the background and delet it to have the logo with a transparent background.  Many tools can be used to create the selection hee I use my action kill white.
    Vector Shape would work better for scaling However it would be best to create the logo from scratch in a vector program like illustrator but I never had the resources to justify the Creative suite. I only had Photoshop.  Recently Adobe gave me and other a year subscription to the creative suite for our participation here.  I still have not installed anything but Photoshop,  A while back I found a program that can create vector patf for black and white art work.  It will not be as good as using something like illustrator. However vector paths can be edited in Photoshop and cleaned up some. Here is the PSD it 13MB because od the gradient http://www.mouseprints.net/old/dpr/AmPm24-7.psd

  • How to make the servo motor to move in steps of set degrees and stop

    how to make the servo motor to move in steps of set degrees and stop

    Hi,
    I think the following document would be a good starting place: NI Developer Zone Tutorial: Single Axis Moves It includes links to several example programs that you may find useful for your application. Keep in mind that there are many motion examples that ship with LabVIEW as well.
    I strongly recommend that you check out the following documents as well:
    NI Developer Zone Tutorial: Simple Point to Point Motion
    NI Dev
    eloper Zone Tutorial: Hands-On Motion
    NI Developer Zone Tutorial: Axis Settings for Motion Controllers
    These tutorials will help give you a good foundation for understanding motion control systems.
    Best wishes!
    Dawna P.
    Applications Engineer
    National Instruments

  • How to make i phone 4s to give a busy signal rather hold and answer?

    how to make i phone 4s to give a busy signal rather hold and answer?

    Sorry, I ment how to make i phone 4s to give a busy signal rather hold and answer when a second call comes in?

  • How to open and read many files from a directory and store contents in 2D array?

    I want to make a VI that opens and reads the data from various files contained in a directory (200 files each with 2 columns) and store these in a single 2D array. For file number 1 I want to store the data from both columns in the 2D array, but for files 2 to 200 I only want to store the second column of each file. Can someone please help?

    Hi Nadav,
    Thanks for your help. I have followed your instructions but i cannot get it to work. I used the LIST DIRECTORY to list the files in the directory - that works. However, how do I read each of the 200 files using READ FROM SPREADSHEET FILE without me having to manually select each of the 200 files? So, if I use LIST DIRECTORY to list all 200 files in an array, how do I get each of these to open and store the data in a 2D array? Here is what I have done (File called read_files.VI) Could you please help me? Thank you very much in advance.
    Attachments:
    read_files.vi ‏18 KB

  • I recently received a mac book air 11 inch for christmas ... i beliehve it was bought in the states from my father i was unaware of the specs until i opened and read it... and i was wondering if i can still do the upgrade to 8gb ram and bigger flash drive

    i recently received a mac book air 11 inch for christmas ... i beliehve it was bought in the states from my father i was unaware of the specs until i opened and read it... and i was wondering if i can still do the upgrade to 8gb ram and bigger flash drive.. is this possible and for how much? its only a week old.

    Your 14 days are up, however you could take your case to Apple Inc. regarding same,
    however those are the stipulations.
    RAM cannot be upgraded however, period, its permanent on the logic board after mfg.
    As for the SSD (solid state drive), upgrading same is a bad premise 9 times out of 10.
    No notebooks is a mass storage device, and you need an external HD for data redundancy and backups regardless.
    data that is static on your SSD and not used very often has no logical reason to be ON the notebooks, and best saved on a superslim external HD ($60)
    SSD are very expensive, even a small one,  HD are cheap as dirt and users are recommended to have one regardless for many good reasons.

  • Hi,how can i change the default settings on my adobe readerX1 such that it will display all my pdf files according to their individual cover pages (as cover picture thumbnails)before i click them to open and read........i really enjoyed this feature as a

    hi,how can i change the default settings on my adobe readerX1 such that it will display all my pdf files according to their individual cover pages (as cover picture thumbnails)before i click them to open and read........i really enjoyed this feature as a default settings upon installation in previous editions of adobe reader .i use a windows 8 pc now.thank

    For sideloaded content the nook pulls the metadata from ePub file itself.  I would suggest looking at a program like Sigil or Calibre that will let you edit the metadata in the book to make it appear like you want.
    For the PDF vs ePub - No, that's the way PDFs work (think of them as graphics, not text), wheres ePubs are Web Pages - so  no you can't them to behave exactly alike without converting the files.

  • I have pages on my MAC, friends cannot open.  How do I save a file so a Microsoft Word user can open it?

    I have Pages on my MacBook Air, friends cannot open when I send as an attachment to an e-mail. How do I save a file so a Microsoft Word pc can open.

    Welcome to the Apple Support Communities
    Pages documents can only be read on another iPhone, iPod touch, iPad or Mac with Pages installed. To make a document compatible with Microsoft Word, you just have to export the document.
    To do that, just open the document with Pages, and then, go to File menu > Export > Word, and after exporting that document to Word format, just send it

  • Every time I start my Apple TV it shuts down. I have to unplug it and wait for it to reconnect before I can use it.  Any suggestions?

    Every time I start my Apple TV it shuts down. I have to unplug it and wait for it to reboot before I can use it.  This makes turning on Apple TV a very long process.  Any suggestions?

    That would be very hard to do, as I would have to do a lot of things--including moving furniture to get at the back of a receiver--and I'm not at all sure that the receive could accommodate it.
    The process is like this:  I dial the receiver to the Apple TV input.  The light comes on, like it's connecting, but then the Apple TV goes dark before any connection happens.  Then I unplug the power cord, wait a few moments, and plug it back in.  Then the Apple TV actually connects, but only after a full reboot (setting time, etc).

  • Every time i try and open safari i get an error message.. how do i reinstall safari so that i can open and use it?

    every time i try and open safari i get an error message.. how do i reinstall safari so that i can open and use it?

    Create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.com/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    If that new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • The hinge makes a clicking sound at the right corner as i open and close the lid

    I bought my Mac 2 weeks ago and The hinge makes a clicking sound at the right corner as i open and close the lid. Someone help me out Please

    At the bottom of this page click
    Then on the right side of the next page click
    On the next page click
    Select a topic
    Select Other Topics then Hardware not working as expected
    Finally, provide your contact information and Apple will call you!

Maybe you are looking for

  • Re: Payment_method_lookup_code in supplier conversion using api

    Hi,      We have a requirement where we need to update payment_method_lookup_code and Pay_group_lookup_code in ap_supplier_sites_all table (for the provided vendor details like vendor name,vendor site code and account number). Can you please explain

  • "jco.server.unicode" is gone in JCO 3.0.5??!!

    Recently  we have migrated from   JCO 2.1.8  to  3.0.5.   Currently we are witnessing some problems with communications from non-Unicode Sap systems. In the previous version  (JCO 2.1.8)  JCoIDoc.Server had a property "jco.server.unicode"  in the lat

  • Downloading OS X 10.6 from Snow leopard 10.5.8?

    I am trying to get Mountain Lion however I need mac app store to do this which means I have to have 10.6... I have 10.5.8 how can I upgrade to 10.6. Please say I don't have to spend a fortune just to upgrade by 0.0.2. Can anyone link me to a download

  • Connectin the 7.1 Speaker system to LCD TV

    i recently got a Lg LCD tv (26 inch)....just wanted to know that can i connect the 7.1 speaker system to the and the DVD player and will it give good output......and if not.....whts the solution or the alternative to it

  • Elements 10 and nik software.

    I recently upgraded to elements 10 and have installed nik software. While I can access nik through the drop down filter menu I cant get the selective tool to come up on the desktop when i open the programme. The Automation tools is also not highlight