08-08-2017 10:39 AM
Hi to all,
I Created a vi that display the values from the acquisition device and i tried to save the acquired data in a spread sheet file but it displays the first 10 values repeatedly for every each 10 steps did i miss something here? i have attached a vi to this
Regards,
Dinesh
08-08-2017 10:44 AM
You keep adding data onto a shift register every time, so you will re-write values. For example, with a single sample you are doing this:
1
1, 2
1, 2, 3
1, 2, 3, 4
Can you move the file I/O outside of the loop?
08-08-2017 11:04 AM
08-08-2017 12:26 PM
i just did as you said but it was not working, how exactly i have to do it make it work
08-08-2017 12:50 PM
08-10-2017 05:41 AM
I have attached you a vi that i made change here, when i put the write to spreadsheet file.vi outside the while loop it was displaying it, or am i doing in a wrong way?
08-10-2017 07:40 AM
Did you read Ben's earlier post? Read it again. Notice he suggests changing your DAQmx Read function!!! You chose not to do that (which is OK), but his comment was an attempt to help you by having you follow the most important part of his advice!
As I look at your VI, I see the following (feel free to correct me if I have missed something):
Look closely at the Write Delimited Spreadsheet function (I'm using the current name). Do you see (and understand) the importance and usefulness of the Append to File input? Do you see (and understand) the meaning of the Transpose input?
Think about breaking up your file I/O into three parts:
Now ask yourself -- do you need the Shift Register to hold all of the Array data?
The only (potential) downside with this design is that writing the new loop data into the spreadsheet takes place inside the loop. But you basically have a tenth of a second to write a few tens of numbers to a file -- should be no problem.
Bob Schor