LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STILL having trouble recording data.

Ive created an array of data which can be seen in the attached file when all three state machines are in the 'write values' state. I just cant figure out how to write these values to an excel file, in a test report format i.e test operator, UUT No, serial number etc etc...

 

Ive tried the TDMS format, the excel tool kit and report gen and I'm not getting anywhere. I can write a CSV file and open this in excel, but this is usless for data manipualtion/ graphs etc. I want to write directly to a specific excel file and create a table of data.

 

Please help

 

Richard.

0 Kudos
Message 1 of 3
(3,080 Views)

Also, appologies for the title - should be recording*

0 Kudos
Message 2 of 3
(3,078 Views)

If you search the forums for Revised " (that's the word "Revised", a space, and a quotation mark), you'll find an Example-Tutorial I posted a while ago on creating an Excel Report using the Report Generation Toolkit.  It shows the "Write the entire Report All At Once" method.  If you are going to be writing Excel one row at a time, you'll want to modify the example so that the code to open and "prepare" Excel is done before the While Loop, the code to actually write Table entries is done inside the While Loop, and the code to Save (= Write the Excel Workbook) and Dispose (= Close Excel) Report are done when the While Loop exits.

 

If you do end up writing one row at a time, two things to note.  First, Easy Write Table expects a 2D array, and a row is only a 1D array.  This is easy -- just pass it through a Build Array to turn it into a 1-row by N-columns 2D array.  The second is the clever use of the Starting/Ending Row-Column connectors in Write Table.  Use a Shift Register and wire Next Cell Bottom Left to the right-hand register and the left hand to Starting Cell.  This means that when you finish writing a row, the next row will appear right below the row you just wrote (which, I presume, is what you want).

 

Give it a try.  Since you have LabVIEW 2015, you have the RGT.  If you get stuck or have problems, post your code again.

 

Incidentally, I didn't look carefully at your code, but it seems to me that you more-or-less "doing the same thing three times".  That suggests a For Loop and array structures.  You also have far too many local variables (the proper number in any good piece of LabVIEW code is zero).  Try to come up with a clever way to fix this.  I understand why you have separate Board X Passed instead of an array "Board Passed" (to get the pretty Front Panel), but you could have a Case where you wire "Board Number" and if it is 1, you output "Board 1 Passed", 2 gives "Board 2 Passed" (I know, I should start counting from 0 = Board 1 Passed, and I would code it that way, but I'm talking "principles" here ...).  Do try to "modularize" your code -- it keeps things neater and helps prevent mistakes.

 

Bob Schor

0 Kudos
Message 3 of 3
(3,054 Views)