LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone please help me create a VI that inserts a cell in excel spreadsheet created from TDMS file?

I attached my VI and my TDMS file. My VI is running perfectly; all I want is to insert a cell below "Ambient temperature" (12th row) in the excel spreadsheet that comes out after running the VI.  i would like to insert a row programatically in labview, not from excel.To see what I am talking about, just my VI. Can you please modify my VI and please if you can post what you have, I will appreciate it.

P.S: Save the TDMS file that I attached somewhere and modify the path on the block diagram. To run the program.

Thank you so much in advance for your help. 

Download All
0 Kudos
Message 1 of 4
(2,092 Views)

OK, I have some questions.  I'll preface it by saying I've not done much with TDMS files and formats (hmm, maybe I should try to open and look at your TDMS file for clues), but do have some questions and observations about the Excel file your program creates.  But first, now that I suggested (to myself) that I look, let me try to open your TDMS file and "look at it" ...  Aha, some questions now make sense (the reason the Excel Sheet has "Test" between "Mod2a3" and "Mod2a5" was because the TDMS file looked like that.

 

So first question is "Why bother"?  When I double-clicked the TDMS file, I got an Excel Workbook with a Root Sheet describing the other three Sheets that showed the three types of data, Analog, Thermocouples, and Delta Temp.  You could (should?) create your own 3-sheeted Excel Workbook that had some/all of these Data displayed -- I, personally, think it might be easier than having a single Giant Sheet that "mixed and matched" data of different types, sample sizes, etc.

 

Next, I'm confused by your request to put a single cell below the first data row that comes from Thermocouples.  Why isn't this a row of data?  Everything else in this (sub-)table is a time-series, so inserting a single cell seems, to me, to "break" the structure of the Excel Workbook.

 

I'm confused by Rows 10 and 11 (Excel-numbering, i.e. rows starting with Cells A10 and A11).  Not sure what you want to put there, nor why Row 10 has some cells with "Run", some with "Heat", and some blank.  Again, I'm not sure what you are trying to do with this Excel Sheet.

 

[You'll notice I underlined "what" in the previous sentence.  I have a colleague who has been using LabVIEW even longer than I, and whose code I frequently critique.  A frequent question I ask is "What are you trying to do", and he starts by saying "I want to read this TDMS file and write this Excel Spreadsheet using the Report Generation Toolkit", and I interrupt and say, "No, don't tell me how you are going to do something, tell me what you want to do."  He eventually "gets it" and says "I want to organize the data so I see it in this specific format", that is, he says "I'm starting here, I want to end there" without obsessing about how he was going to get there.  We usually do it "some other way" ...

 

So try to (in a few sentences) explain what you want to do with the TDMS data.  It might be "I want to isolate this-and-so data so that I can use LabVIEW to create plots of X as a function of Y (or of time)", or "I want to create an Excel Workbook that resembles Company-Specific Template for which we've already written Excel routines that let us analyze the data", or "I want to take all these data and write a smaller Excel Workbook that provides a simplified view of a subset of the data, using Simplifed Template as a model".  Knowing where you are coming from (which you provided by attaching the TDMS file, thank you very much!) and where you want to do (which I'm unsure about, but don't think you're quite there) should make this process straight-forward.

 

Bob Schor

 

0 Kudos
Message 2 of 4
(2,019 Views)

Hi Bob,

First of all, I am going to thank you for your constructive criticism. 

So basically I am trying to copy the template (see attached file named "final report").

The delta temp workbook is what below ambient and other names (See attached file).

I hope things are clear now as I attached my template.

0 Kudos
Message 3 of 4
(2,012 Views)

Well, I can now see some of what you want.  Frankly, I find it a poorly-designed Excel Worksheet (having alternating rows be data and delta-T does not appeal to me, but maybe there are good reasons for this arrangement that I just don't understand).

 

If I look at the TDMS Data File, I have an even harder time, as there seems to be little correlation between the data in the TDMS file and the entries in the Excel Sheet.  When you open the TDMS file, does it open using Excel?  [It does for me, but I have a hard time understanding how the Excel-like arrangement of the data in the TDMS file gets "translated" into the data I see in the Excel Worksheet.  It just doesn't make sense to me].

 

Sometimes when you have a complex problem based on an established data set (such as here), particularly when the format is firmly fixed, but things aren't working well, it can help to stop, develop a very simple example, create a small, easy-to-read and easy-to-understand TDMS file (with only a few categories), create a corresponding simple Excel Template, and use that to get the techniques understood.  That's what I recommend that you do.

 

Bob Schor

0 Kudos
Message 4 of 4
(1,980 Views)