LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Report to Excel File not Saving

Solved!
Go to solution
Solution
Accepted by topic author wilson261

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q0000019gxqCAA&l=en-US

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 11 of 12
(641 Views)

Why are you re-writing Excel for every line while leaving it open?  Many years ago (my first major LabVIEW "challenge"), I rewrote a data acquisition system used to study sound localization in large poorly-behaved primates (they were mostly undergraduates).  The study was managed by an Excel Workbook with I-don't-remember how many columns (at least 100, each row constituting a Trial, and the columns specifying all the time, position, frequency, loudness, etc. parameters of the sound stimuli.  This was a LabVIEW Real-Time Project, with a PXI system running the A/D, D/A, and digital I/O, with Network Streams sending data (at 1 kHz, as I recall) to the Host who streamed it to disk.

 

The Excel Workbook had several WorkSheets, but the main one was the Trials Worksheet.  Each trial involved moving a sound source over a ±30° azimuth and ±20° elevation cylindrical field a few meters from the subject, plays pulses of band-limited noise (a number of parameters were used to characterize the sound), with additional "bells and whistles" (like laser targets that could put a fixation point on the cylindrical wall).  For each trial, we saved the position of the sound (as measured by feedback from the drive systems) and subject's estimate of the location in 2D of the position of the sound source.

 

We left Excel open and just updated the row corresponding to the current Trial.  It didn't make sense (to us) to constantly rewrite and update the Excel file for each Trial, especially because Excel is a rather massive program in itself.  Where we had problems in this Project was on the Real-Time side, which was prone to crashing (the rewrite

largely fixed this, partly by moving file I/O out of the Real-Time processor and streaming it (via Network Streams) to the PC, who streamed it to disk.

 

Recently, I've written some routines for animal behavioral studies, and have used LabVIEW's Write Delimited Spreadsheet functions (which have an "Open, go to End of File, Write, Close" pattern) which provide a means of saving "spreadsheet-like" data streams that (for modest data rates) keeps the data file "mainly closed".  This works pretty nicely, and is much simpler to use than the RGT (though I really do like the RGT for integrating LabVIEW and Excel for processing data).

 

Bob Schor

Message 12 of 12
(629 Views)