ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing multiple time histories to a file

I am taking time history data per cycle for a system cycle time of about 3
seconds (it may vary from cycle to cycle). I need to sample at a rate of
about 100 or 200Hz and I need to store the data for about 200 cycles. Since
this cycle data will be used in Excel, I would like to format the file accordingly.
The ideal way to format the file for Excel would be to write the data in
column form with a new column for each cycle. However, I can't find an easy
way to do this. Any suggestions???

Currently, I have the program write the data in row format, but Excel only
lets you make 256 columns, which only lets me take a little over 1 second
of data for each cycle. Also, I would like to stay away from storing the
d
ata in an array and writing when the program is done due to memory considerations.
I've also looked into using ActiveX and Excel, but the documentation on
this feature is poor and I'm also concerned that running Excel will slow
down LabVIEW.

Is there any easy way to do this without writing a program to post-process
the data?

TIA
Melissa Niesen
Fisher Controls
0 Kudos
Message 1 of 3
(2,713 Views)
One of the ways I've done this without using ActiveX (usually my
first choice)is to write the output data in row format the way
you have and then, once the data has been collected, read the
whole file back into memory as a 2D array, transpose it, and
write it back to disk. This is memory intensive, but since your
datalogging is completed, it shouldn't cause you a lot of
problems.

Another way to do it is write the data to disk at each cycle in
binary logfile format using the low-level file functions. When
the datalogging is complete, you can read the log file directly
into a 1D cluster array. Use a for loop to index this array
into a 2D array, transpose, and write to disk as a delimited
string. Or, since you are done with logging, you might want to
consider poking the d
ata directly into Excel using ActiveX and
the Range method. There are some newer examples on NI's site
that have better documentation than before. You can email me if
you need more info (remove anti-spam).

MaxMar


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
0 Kudos
Message 2 of 3
(2,713 Views)
Melissa:

I've attached an automatic file renamer vi. that will do exactly what you want to do. We use it for collection of ionspheric sounding data at frequent intervals. You can change (append to) terminal on the Spreadsheet write node, if you want to append columns, but you might find that creating lots of small files is the way to go. (default mode of this vi.)
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 3 of 3
(2,713 Views)