06-14-2016 02:00 PM
Hi,
In the Host PC I am running a while loop at a fixed rate (= 100 Hz, say). An angle data is being read in the while loop. So, at every iteration of the while loop one angle (in double format) is being read. I can directly plot it in a Chart. I want to plot this data in waveform graph with t0 = 0; dt = 0.01 sec. To do this I need an array of say 100 elements, where each element is an angle data. To do this with shift register and build array will be cumbersome. Is there a easier way?
Thanks
06-14-2016 02:07 PM
Can you explan what you mean by "cumbersome"?
06-14-2016 02:30 PM - edited 06-14-2016 02:31 PM
Hi Altenbach,
The way I was doing it, we would need to add lot more elements to the shift register. Since the rate is 10 msecs, so there would be 100 angle data in every sec, and we would need an array with size 100.
Thanks
06-14-2016 02:33 PM
Just use the Data Queue PtByPt.vi to keep your array. Things get a lot simpler then.
06-14-2016 03:17 PM - edited 06-14-2016 03:19 PM
All you need to do is keep the array in the shift register.
We replace the oldest element (index 0), then rotate the array, then graph it.
Since your x0 and dx is fixed, you can set in once on the graph properties and then graph the plain array. No need to bundle. Once you save that VI, these settings will persist. (or you can set it once at program start as shown)