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.