LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Column in Excel

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(4,464 Views)

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

Message 2 of 7
(4,453 Views)

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

0 Kudos
Message 3 of 7
(4,441 Views)
There is an Express VI to set the attribute for your data.
0 Kudos
Message 4 of 7
(4,437 Views)

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.

Excel Demo.png

Bob Schor

Message 5 of 7
(4,426 Views)
Solution
Accepted by scott4
More code would be required to create and write the column headers and to make sure it's done only once. By using the set attribute function, you add a single function to the block diagram.
Message 6 of 7
(4,416 Views)

Thanks Bob and Dennis. I used the set dynamic data attributes express VI and it worked a treat!

0 Kudos
Message 7 of 7
(4,410 Views)