LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export Waveforms to Spreadsheet Extra Lines

Hi All,

 

Another Newbie question, I'm afraid.  The problem is that I am using Export Waveforms to Spreadsheet function, and am getting my report in the format I want except that there is a blank line between each iteration of the report.  Note that I am setting append to file to be true; this test is going to run literally for weeks, and I just want one huge *.tsv file that contains all of the data, with a single timestamp column at the left of the data records.

Note also that I am recording redundant information, by also using the Write to Measurement File vi.  this one has a single timestamp at the head of the report, and then just rows of data; it's my backup in case the power goes out or anything during the long run of the program.

 

To be clear; the data looks like this:

 

TIME STAMP     123.456     123.456

                                                    

TIME STAMP     123.456     123.456

 

TIME STAMP     123.456     123.456

 

etc.  I want to be able to open this file in Excel and create graphs, etc.; so I don't want that extra line of white space.  Any ideas?

 

 

DAQ REPORT.JPG

 

 

Thanks,

 

Danielle

0 Kudos
Message 1 of 19
(6,012 Views)

I just whipped up a simple VI and I do not see the behavior you're describing. My guess is that the second DAQ Assistant that you have there is returning more than one point since you do not have the constant of 1 wired to it, like you do with the others.

 

Notes:

  • What is the point of using a string to create a hard-coded path and then using a String to Path function? Why not just have a path constant in the first place? 
  • Your code is a greedy loop. It's not clear if this is intentional. 
0 Kudos
Message 2 of 19
(5,993 Views)

Hey, thanks.  I'll give that a try.  On your second observation; pretty much most of what I am doing in LV at this point is unintentional.  Hopefully that'll change...

 

Danielle

0 Kudos
Message 3 of 19
(5,988 Views)

Afraid that wasn't it.  I should have known; the file created by the parallel "Write to Measurement File.vi" doesn't have those extra lines.  It seems to have something to do with the way that the Export Waveforms to Spreadsheet.vi interacts with the DAQ assistant creations.  If, for example, I tell the three parallel Express instruments to collect three samples instead of one, there are three lines of data then a line of white space.  Wouldn't be an issue if I could just write the thing to collect thousands of samples before leaving the loop, but then the graphs don't update until that whole thing has run.

Sort of in conjunction with your comment on the greedy loop thing; could I write something that opens the data file and truncates a carriage return and several tabs (which make up that extra line) and park it in the lower right-hand corner of the loop, so it would iterate once each time the thing loops?  Sorry that isn't clearer; just haven't done much with LV yet...

 

Thanks,

 

Danielle

0 Kudos
Message 4 of 19
(5,975 Views)

Instead of wiring the evil dynamic data directly, try using the From DDT function to convert to a waveform data type which is what is expected. You have some coercion going on.

 

Also, using three separate DAQ Assistants is just plain wrong unless you have three separate DAQ cards. Use one.

0 Kudos
Message 5 of 19
(5,962 Views)

Oh I do have three separate cards.  In fact, I don't see any way to split a single card into more than one DAQ assistant and make it work...

Thanks for the tip, though.  You're probably right about the data type issue.  Will give it a shot.

 

 

0 Kudos
Message 6 of 19
(5,955 Views)

Odd.... When I did my test I used the Simulate Signals Express VI since I wanted dynamic data to try and replicate your VI as much as possible. Each dynamic data wire had one value in it, and the Export Waveforms to Spreadsheet VI generated the rows without blank lines between them.

 

Maybe if you post the VI it might shed some light. At least the DAQ Assistant configuration can be looked at. 

0 Kudos
Message 7 of 19
(5,936 Views)

Thanks, this is it.  I am not currently able to get at the computer that's running this vi, but will be able to change it on Monday of next week.  Hopefully someone will spot the problem in my code.

 

Danielle

0 Kudos
Message 8 of 19
(5,921 Views)

The problem isn't the dynamic data. The problem is the Export Waveforms to Spreadsheet File VI. Or rather, how it has changed. I did my test in LabVIEW 8.2, and I saw no extra lines. However, in LabVIEW 2009 the Export Waveforms to Spreadsheet File VI does not function the same way. It adds an additional row. It's not clear to me why it does this. It seems completely unncessary to me. Regardless, that's what is giving you the extra row. The same thing would happen if you were to feed in a waveform datatype.

 

Thus, you have two choices:

  • Make a copy of the Export Waveforms to Spreadsheet File VI, rename it, and modify it so it doesn't add the extra row.
  • Write out your data using the Write to Spreadsheet File VI. This requires a bit of massaging of the data, but it's not that bad. See attached example.
0 Kudos
Message 9 of 19
(5,908 Views)

Thanks so much.  I kind of thought I was losing it, as I'd looked back at prior work (done in 8.6) and saw that I'd written the data successfully, in the past.  I have about an hour this morning while the trial is shut down; will try to implement your fix. 

 

Thanks,

 

Danielle

0 Kudos
Message 10 of 19
(5,864 Views)