LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

headers in files.

Hi,

 

I am currently saving into files using the attached vi. The data is being generated in several different loops, gathered in an array in one loop, and them saved in this loop using queues.

I am also saving data in a matrix, which dimension updates at every iteration. This works fine, though I'm happy of more efficient solutions, if something comes across.

 

1) Do you think the write to measurement file.vi is better than the write to spreadsheet file.vi ?

 

2) How do I insert headers for each column?

 

Thanks for help,

 

Kentmey.

Kentmey
0 Kudos
Message 1 of 2
(1,891 Views)

Kentmey wrote:

1) Do you think the write to measurement file.vi is better than the write to spreadsheet file.vi ?


"Better" in what way? Faster? More flexible? Nicer icon?

 

Your VI has more code that what you actually need. With respect to what you actually have:

  • Do not use Insert Into Array when you actually are trying to append to an array. That's what Build Array is for.
  • Do not use a local variable when you already have the terminal. I'm referring to the "millisecond" control.
  • Your code is creating an ever increasing array. This means you are allocating more and more memory with each iteration. Eventually your VI will slow to a crawl and die.
  • If the input path is empty, the Write to Spreadsheet File will ask you for the filename to use in each iteration of the loop. You should use a shift register to store the name of the file.
  • Where is the data enqueued?

As I said, you have way more code than you need. If you're enqueueing an array of values, when you dequeue, you do not need to append it to anything. Just wire the output of the Dequeue function directly to Write to Spreadsheet File, and set its "append" to true.

 


2) How do I insert headers for each column?

You need to write those headers to file before you start appending your data. Create a 1D array of strings that corresponds to your headers, and call the Write To Spreadsheet File, passing it that array of strings. Then, inside the loop you'd be appending your data to the file.

0 Kudos
Message 2 of 2
(1,880 Views)