01-24-2011 02:13 PM
I am trying to save data together with the index every N cycles,then put them into a 2D array,
I managed to save the data every N cycles, but I am having some difficulty of saving them with out the zeros in between.
E. g
i y save every 3 cycles i y
0 0 0 0
1 10 3 30
2 20 6 60
3 30
4 40
5 50
6 60
7 70
8 80
9 90
10 100
Please refer to the attached VI
Thank you
Solved! Go to Solution.
01-24-2011 02:31 PM
Try this.
01-24-2011 03:51 PM
Thanks JM,
Thats helps a lot !...
Ed
01-24-2011 04:31 PM
Hey JM
Sorry to ask you about one more help. Is there any way that I can also limit my 2D array with only the newest 4 obtained data ?
For example that,
when i or the counter = 19, only the index 18, 15, 12, and 9 together with their values are store in the 2d array instead of all of them, as I am trying to used only the newest data for my calculation.
Thanks again ,if you can help me up with this last doubts that I have. I tried using the delete from array block , but I am still unable to get it working right. sorry to ask you for help again , but I am really new to labview....
01-24-2011 04:55 PM
Array Subset and Array length can help you achieve that.
/Y
01-24-2011 04:59 PM
Try this one.
01-25-2011 03:23 PM
Hey Guys,
Sorry to post this question here, but this is related to the same VI
Thanks J. W for showing me how to do the delete from array block, that works perfectly fine.
HOWEVER, when I plot the data on the graph, the plots contradict with the values shows in the table, which I really cannot under stand why this is happening.
Please see attached VI
So sorry to ask this here
Ed
01-25-2011 04:04 PM
You plot the element 1 of the array data.
01-25-2011 04:16 PM
01-25-2011 04:28 PM
Overall, that constant growing and shrinking of the array is not such a good idea. It causes memory thrashing. Better would be to have a constant sized history buffer. Here's a quick draft. Modify as needed.