11-02-2015 08:07 AM
Hello everyone,
I've set up a VI which measures voltage which automatically records the data in excel using Write to Measurement File express VI. I need to record the amount of time elapsed which I've done but the column heading when saved in excel is "untitled". Can I name the time wire so it's automatically added to the created excel spreadsheet? Thanks.
Scott
Solved! Go to Solution.
11-02-2015 08:15 AM
It is difficult to "experiment with your code" if all that you attach is a picture (unless it is a Snippet, which contains executable LabVIEW code "hidden" inside). You could do your own experimentation -- just try it, see if it works, and if you are disappointed with the results, post the code and explain the problem to us.
I generally avoid Express VIs, and always avoid Dynamic Data wires. I therefore don't have experience with Write to Measurement Files writing to Microsoft Excel, but have lots of experience writing .xlsx files using the Report Generation Toolkit. One thing you need to consider is that LabVIEW and Excel have different definitions of "TimeStamps", so writing the TimeStamp itself to Excel can give puzzling results. Try it, see what you get, and come back with your code (attach the VI, or if multiple VIs, zip them together and attach the .zip file) to ask more questions.
Bob Schor
11-02-2015 08:22 AM
Hi Bob,
thanks for your message. I've very new to labview and I'm only just finding out that there's more than one way to get the results you want. I've had a play around with the options with the express VI and had a look at how to add a title to my timestamp but to no avail. Unfortunately my university doesn't have a licence for the report generation toolkit so that's not an option for me.
Scott
11-02-2015 08:24 AM
11-02-2015 08:38 AM
The Good News is that you do have the Report Generation Toolkit, as NI made it part of the basic distribution of LabVIEW with LabViEW 2014 (which seems to be the version you are using). I'm attaching a Snippet (the magical form of a PNG that if you drag it to a LabVIEW (empty) Block Diagram, becomes LabViEW code) that shows taking a Time Stamp, translating it to a String (which Excel should be able to parse) and writing it to a single cell in a Workbook called Demo.xlsx. Note that I'm using the Easy Table function, which wants a 2D array (a Table) of data, so I take my single string, do Build Array (1D array) and another Build Array (2D array).
On my machine, the Report Generation Toolkit functions are the 15th (and possibly last) entry on the Programming Palette of the Block Diagram.
Bob Schor
11-02-2015 08:48 AM
11-02-2015 08:57 AM
Thanks Bob and Dennis. I used the set dynamic data attributes express VI and it worked a treat!