MeganWhite Posted November 8, 2004 Report Posted November 8, 2004 Hey Guys, I was curious to know if it is possible to add header information to a continuous acquiring data write.vi every second without loosing data? I am attaching the case structure where it writes data till the file size is reached and then writes the header. How can I make a loop so that when the file size is not reached still the header keeps updating after every 1 second duration? Megan Quote
MeganWhite Posted November 8, 2004 Author Report Posted November 8, 2004 Sorry guys couldn't get the attachment last time Megan Quote
hfettig Posted November 15, 2004 Report Posted November 15, 2004 Have you considered running two loops in parallel? The first loop constantly generates/gathers the data and writes it into a write buffer. The second loop checks the time, if 1s is up, it updates the header, if not, it copies the write buffer to an output buffer and clears the write buffer. Then it writes the output buffer to disk. This way you decouple the storage part of the task from the gathering part. You just have to avoid the gathering part to write to the buffer while the storage part is clearing it. This will cause a slight delay in you gathering routine, but only for a couple of milliseconds. I attached a buffer vi. Take a look at it and modify it for your use. In the gathering loop, use the 'add to buffer' action. In the storage loop use the 'read & clear buffer' action. Then you can just loop through the buffer elements to save them. Use the 'Initialise' action before you add the first point. Download File:post-1022-1100531206.vi Quote
JackHamilton Posted November 16, 2004 Report Posted November 16, 2004 Megan, A quick way to save the data in segement files without coding it all - is to use the NI "LabVIEW Measurement File". In the configuration - "Save to series of Files" settings you can set the file to be segmented by size, data, time etc. Regards Jack Quote
MeganWhite Posted November 23, 2004 Author Report Posted November 23, 2004 I am already buffering the data with the polymorphic vi AI config and AI read. What I need is when it writes into write.vi the data should be like header data header data... in each file that is created. And all the files created should be in the same format continuously. Writing lvm does not help as I need to buffer the continuous data. Thanks a lot guys Megan Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.