Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

ploting a data in a Waveform Graph in the Host PC

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

0 Kudos
Message 1 of 5
(3,535 Views)

Can you explan what you mean by "cumbersome"?

0 Kudos
Message 2 of 5
(3,534 Views)

pic2.png

 

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

0 Kudos
Message 3 of 5
(3,530 Views)

Just use the Data Queue PtByPt.vi to keep your array.  Things get a lot simpler then.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,525 Views)

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)

 

 

Message 5 of 5
(3,520 Views)