LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to multiple data files via filename, data, and boolean arrays.

I am designing a program that acquires data from 8 identical measurement devices (measuring displacement at approx. 1Hz).  The numeric data is being stored in an array that is refreshed everytime a new measurement is taken.  I would like each measurement device to record data to the filename in a corresponding filename array, but only when the button in the corresponding boolean array is depressed.  Again, this data is refreshed at 1 Hz.  

 

In the interest of simplicity, I was hoping to write data using an auto-indexed for loop, as shown in the attached image.  However, in its current form it is creating a new file for each data point.  Ideally I would like all data points for a given channel to be written to the same file, ending when the boolean is set to FALSE.

 

Anyone have any suggestions?

 

Thanks in advance.


 

 

 

 

 

0 Kudos
Message 1 of 8
(3,417 Views)

Hi Bryan,

 

How do you configure your write to measurement file?

I configure as the one I show in attached screenshots, and everything is working fine.

 

Regards, Kate

Download All
0 Kudos
Message 2 of 8
(3,383 Views)

Hey Bryan,

 

Kate has a good suggestion. Notice that in her configure.jpg that she has append to file checked.

 

Let us know it this helps.

 

Ben

 

 

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 3 of 8
(3,342 Views)
Thanks for the tips.  Your setup would work, but what if the user forgets to rename the file?  Or if they accidentally set two channels to write to the same file?  It would append data to the end of an unrelated file in the first case, and intersperse data from two channels in the second case.  Any ideas on how to work around this?
0 Kudos
Message 4 of 8
(3,333 Views)
Then, you should write an algorithm to check a file path prior to this data recording running.
0 Kudos
Message 5 of 8
(3,323 Views)

I attempted this yesterday with the suggested config settings, but when each data point was written to a measurement file it reset the relative time so that all data points occur at time 0. 

 

Still welcoming any suggestions or advice.  Thank you!

0 Kudos
Message 6 of 8
(3,282 Views)

Neither your data or your approach to saving it makes any sense to me. If you are acquiring data for multiple channels, you should have an array and a single Boolean associated with that array. The way your data is now, you associate a Boolean with each element in the array and I don't see how you are doing that. You need to post the code that is acquiring it. It would seem to me that what you should have is a cluster array. The cluster would consist of a data array and a Boolean.

 

Also, you have no time data at all in a an array of DBLs so how can you expect to save any timing information? If your data array was a waveform data type, then you would have t0 and dt information that would be written to file.

0 Kudos
Message 7 of 8
(3,265 Views)

It's very possible that what I am doing is unorthodox and perhaps a very silly way to do what I am trying to do - this is the first labview program I have written.  As for timing information, given that my sampling rate is so low, the timing data comes from the time that the data is written rather than waveform time data.  That may not be very smart, but I think it works for my application.

 

I will post the VI on Monday when I have access to my computer with the saved VI.  Thank you for the continued help!

Message Edited by Bryan G on 02-07-2009 01:58 PM
0 Kudos
Message 8 of 8
(3,259 Views)