04-09-2015 06:17 PM
Hi,
I am using the report generation toolkit to write data to an excel sheet. I am recieving a lot of data but only want to save the data to the excel sheet every minute. I have found threads about doing this with the Write to Measurement Express VI but I am not using that and am unsure how to translate that code to something I could use. Any ideas? I have tried using a case selector around all of the report generation VIs but that doesn't seem to work...
Any help is appreciated!
04-09-2015 06:28 PM
04-09-2015 08:39 PM
The answer is "Of course this is possible". However, it is not at all clear what you are trying to do.
We have an application where we run an Experiment with Trial parameters that define the particulars of the Trial. Each row of the Spreadsheet has about 60 columns. Each Trial, we read the entire row, and at the end of the Trial, we write the row back (filling in a few columns with Trial-specific results). Trials take from 5 to 50 seconds (depending), and an Experiment can have 150 Trials. We do it all with the Report Generation Toolkit -- so can you.
Bob Schor
04-10-2015 02:29 PM
Yes I figured I had to use the Elapsed Time function and that is what I have hooked up to the report generation portion of the program. However, it is still reporting all of the data. I only want it to report every minute and to report the average of all the data taken in that minute. I am using the mean.vi in my subvis to take the average of that data (if that is the correct way to go about it). What am I missing?
04-10-2015 02:47 PM - edited 04-10-2015 02:47 PM
You are writing all of your data to the report when you exit your main loop.
If you only want to write a one minute intervals then you need to have your write to report inside your program loop.
You also will have to rewrite your report section almost completely if you don'w that all the headers repeated with every write
Frankly I have found the report tool useless.
04-10-2015 02:57 PM
I tried putting the report generation inside the while loop but it stopped with an error which I think was caused because the report generation creates a new report and if it is in the loop, then it will create a new report every time it is just supposed to be recording the data. Maybe that is wrong but as of now, my program isn't working if everything is inside the while loop. Unless, what I have said is incorrect and I just connected it wrong?
04-10-2015
03:00 PM
- last edited on
04-26-2025
05:51 PM
by
Content Cleaner
Yeah that is one of the reason's why I found it useless.
Do you really NEED to out put an Excel file (.XLS)?
It is a lot easier to just write text to a .csv file and open it in Excel.
If you really need to have an Excel file out put then I suggest you look into one of the third patry add-ons like XLR8. https://www.ni.com/en-us/shop/product/xlr8.html
04-10-2015 04:42 PM
Frankly I have found the report tool useless.
I, on the other hand, find it Wonderful, Powerful, a Joy to use. It took me about ten minutes to knock off a demo that writes rows of data at the rate of once per second (you can obviously do it slower ...). Each row is 5 random numbers + the row index (so the first row is (0,1), the second is (1, 2), etc. I didn't put in "fancies", like headers (which would be done outside the While loop).
The computation inside the In Place Element structure makes each Append Table to Report start on a new row. The other "trick" is that this function needs a 2D array, so I pass my 1D array of 5 numbers through a Build Array function to "fatten it up". And no ActiveX is required!
Bob Schor
04-10-2015 05:12 PM
@Bob_Schor wrote:
Frankly I have found the report tool useless.
I, on the other hand, find it Wonderful, Powerful, a Joy to use. It took me about ten minutes to knock off a demo that writes rows of data at the rate of once per second (you can obviously do it slower ...). Each row is 5 random numbers + the row index (so the first row is (0,1), the second is (1, 2), etc. I didn't put in "fancies", like headers (which would be done outside the While loop).
The computation inside the In Place Element structure makes each Append Table to Report start on a new row. The other "trick" is that this function needs a 2D array, so I pass my 1D array of 5 numbers through a Build Array function to "fatten it up". And no ActiveX is required!
Bob Schor
Nice, can you help @kmarcella work that into his code?
04-10-2015 10:31 PM
Nice, can you help kmarcella work that into his code?
Well, the example that I post shows the Big Picture for doing what KMarcella wants to do, namely collect data periodically (like once a minute) and write all of the data, presumably one Excel row at a time, to an Excel Workbook.
The Original Poster has the best understanding of the details of the task, but here are some suggestions that should help him (or her!).
Note that these phases are illustrated in the example -- there's stuff before the loop, the loop, and stuff after the loop.
Bob Schor