From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuous Data Waveform Write

Solved!
Go to solution

Hey,

 

I am having trouble modifying the Continuous Data-Write to Spreadsheet code found here.  I have modified the code to write waveform data to a spreadsheet so I can get a timestamp for the data I am collecting.

 

My problem is this:  Everytime I run the code it rewrites the waveform header information into the spreadsheet, so I might get 100 lines of good timestamp data and then 4 lines of header information, 100 more lines of timestamp and then 4 lines of header, and so on.  I have been using the append feature of the write to spreadsheet, which I suspect is part of the problem.

 

How can I get the waveform data to continuously write to the spreadsheet and only write the header information once?

 

I have attached my code and an example of the multiple header write problem.

 

Thanks!

0 Kudos
Message 1 of 18
(3,703 Views)

Here is the .txt file of the multiple header writing.

Download All
0 Kudos
Message 2 of 18
(3,702 Views)

If you look at that VI, you'll see it has an input at the bottom called Write Headers?  that defaults to true.

 

All you need to do is input a true to that on the first call, and a false on every iteration after that.

0 Kudos
Message 3 of 18
(3,694 Views)

Thanks for the reply!

 

I put a false boolean on the header pin and it leaves a blank line in my data now.  So now every 100 lines of timestamp data, there is an empty line.

 

0 Kudos
Message 4 of 18
(3,692 Views)

I think you've stumbled across a bug in that Waveform to File subVI I found back in December.

 

See this thread http://forums.ni.com/t5/LabVIEW/How-to-write-a-dual-waveform-to-an-Excel-file-without-blank-rows/m-p...

Message 5 of 18
(3,686 Views)

Thanks!

 

Sounds like that is exactly my problem.  Although, I can't open the LV11 vi's that you guys posted.  I'm using LV10.  Do you remember what you modded in the vi to make it work?

 

Or is there anyway to save it as a LV10 vi?

0 Kudos
Message 6 of 18
(3,681 Views)
Solution
Accepted by topic author JPKelly662

It was removing a +1 function after the loop to the lower left of the VI.

 

Here is the VI saved back to LV 8.0.

Message 7 of 18
(3,675 Views)

Works perfectly.  Thanks a bunch!

0 Kudos
Message 8 of 18
(3,670 Views)

Hi all,

 

This is a great place to build my task on. I am going to use the VI you guys have exchanged until now.  I have been a basic LabVIEW user for a while but really trying to up my skills by incorporating some of the standard software frameworks such as the producer-consumer architecture. I have a vi to do data acquisition over nicope and was thinking whether is it possible to integrate this vi with your 'continuous data write' vi in a producer consumer manner?

i.e. my data acquisiiton vi in the producer loop and the data writing into file  vi in the consumer loop?

 

Thanks

0 Kudos
Message 9 of 18
(3,531 Views)

It is certainly possible to use a producer/consumer structure to send waveform data from one VI to the other.

 

(I uploaded a modified version of your VI).  Your stop condition for the While Loop was more convoluted than it needed to be.  And you only need 1 Index Array Function.  It expands downwards so you can access more than one element from the same function.

0 Kudos
Message 10 of 18
(3,526 Views)