LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing 2-D array to spreadsheet file changes value of time column when saved

I have a program that creates a new row in a table each time the loop performs.  Each time the loop performs and a row is added to the table, the program uses the "write to spreadsheet file.vi" to save this new table over the previous table.  The array is also visible on the front panel of the vi.  The program works in such a way that you can stop adding data to the array, start adding data to a new array, then come back to the original by using the "read from spreadsheet file.vi".  My problem comes after opening the spreadsheet file.  The first column of the array, which corresponds to the time when the data in that row was taken, has different values than those that were seen when the array was originally displayed on the front panel.  In fact, all of the rows that were created the last time the program was run with that array have the same value in the time column, while all of the other columns keep their correct values.  Here is an example of what is happening...
 
When I start the program, and run it for 5 iterations, I get a table like this displayed on the front panel:
 

3241713920

85.88012

93.88012

1.735015...

3241713930

85.97603

93.97603

1.747003...

3241713940

84.58855

92.58855

1.573568...

3241713950

84.48096

92.48096

1.560119...

3241713960

84.93667

92.93667

1.617084...

 
This array is saved to the spreadsheet file with each added row.  If I initialize and build another array, then come back to this first array using "read from spreadsheet file.vi," I will receive the following table:
 

3241713920

85.88012

93.88012

1.735015...

3241713920

85.97603

93.97603

1.747003...

3241713920

84.58855

92.58855

1.573568...

3241713920

84.48096

92.48096

1.560119...

3241713920

84.93667

92.93667

1.617084...

If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  One option I have contemplated is just having each individual row appended to the file instead of resaving the entire array with each iteration.  However, I would prefer to do it the way I am currently doing it, so I can pass the array through each time and perform different tasks on it, such as averaging the values in columns over different time periods.  Thank you in advance to anyone who can help. 
0 Kudos
Message 1 of 4
(2,744 Views)

Can you post your code?  This should not be a problem because it is only writting to file what you give it.

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 4
(2,727 Views)

DWDerr wrote:
...
If anyone could tell me why this is happening and/or how to fix it, that would be greatly appreciated.  ...
This KnowledgeBase article may help.  I think things changed in LV8.20, but I could be wrong.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 3 of 4
(2,717 Views)

Donald, that link was perfect.. what an easy fix to the problem.  Thank you very much.

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