04-13-2010 06:32 AM
Dear all,
I have written some vi on a small part of my application. Basically, every 20 sec, I will acquire a set of readings (array) consisting of 10 data points known as T1. So at every timestamp, there should be 10 datapoints plotted on the same timestamp. Then 10 sec later, another timestamp with again 10 datapoints. I wanted the data to be plotted and updated every 20 sec and continue till I stop the program. At the end, I hope to see 10 horizontal lines.
I face some problems now and hope someone can help me on this? The problems are how do I plot the 10 datapoints at every interval of 20 sec. How do I also keep on updating the data? I know I need to build arrays but I am not sure how to do it.
Someone who knows please kindly help me on this as I have been trying but to no avail.
Solved! Go to Solution.
04-13-2010 08:21 AM - edited 04-13-2010 08:24 AM
Here is one way to do it:
By transposing the array, the second for loop indexes by the plot# instead of by the timestamp. Then you just bundle the plot data with the array of timestamps.
04-13-2010 10:40 AM
Dear All,
I have tried the program again. But there is still some problems.
How do i create the time interval of plotting the 10 datapoints every 20 sec interval. Meaning how i plot 10 datapoints at one timestamp and another 10 datapoints another 20 sec later?
Right now, the x-y graph will refresh itself after 10 loops. However i also want to keep the previous datapoints in the previous timestamps also. How do i modify the program as i think i need to use build array function and shift register somewhere.
Can anyone assist me on that? Thanks!
04-13-2010 11:14 AM
Dear All,
I have tried the program again. But there is still some problems.
How do i create the time interval of plotting the 10 datapoints every 20 sec interval. Meaning how can i plot 10 datapoints at one timestamp and another 10 datapoints another 20 sec later? Right now it seems that if i introduce a delay of 2 sec, the graph will be plotted 2x10= 20 sec later. However i want the scan rate to be 20 sec. If i set the delay at 20sec, then i will have to wait for 20x10=200 sec right? Is there a way to make it plot every 20 sec interval interval but not 2 sec scanning rate?
Right now, the x-y graph will refresh itself after 10 loops. However i also want to keep the previous datapoints (plots) in the previous timestamps also and it should be continuing since i started the program . How do i modify the program as i think i need to use build array function and shift register somewhere.
Can anyone assist me on that? Thanks! |
04-13-2010 12:37 PM
First try to understand how data is stored in XY graphs, there are 2 different ways a) array of clusters and b) cluster of arrays. Depending on how you get the data you beter use a or b. Since you get 1 point at the time (every 10 sec) you should use method a.
Then, there is an exemple called XY Chart, use this one as a start and set the "Chart history size" to 2 since you want to view only 2 points a the time. If in a later stadium you want to see more points, just change that value and all will continue to work.
If after modifying it, something doesnt work, post what you tried and we can help you further.
04-13-2010 12:52 PM
Is the attached screenshot what you want or should each of the 10 points get a different colour?
I used only 2 sec between 2 sets of 10 datapoints instead of 20 (couldn't wait that long :))
04-13-2010 01:10 PM