LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw XY graph from initialized array, but only plot 'data'

Hi, I'm plotting 16 xy graphs and two multi plot xy graphs. The max number of points is 65535. I'm currently using build array to append current data and plot the updated array in xy graph. So I have 18 arrays being appended to as the corresponding data is acquired. I would like to rather initialize the various arrays beforehand (read it's better?), but because I would not always plot the max number of points, I would like to only plot the 'data' points in the array so that my scale on the graph updates as more data points are acquired. Initialize array to invalid value and then only plot array up to this invalid value?? How would I do this or am I on the wrong track here? Please help - my PC can't handle all the
se build arrays and I must find a better way! Thanks for the help, Madri
0 Kudos
Message 1 of 4
(3,202 Views)
Hi Madri

I think you may be able to get what you need if you initialise your array with NaN (use a normal numeric constant but type in NaN rather than 0). This way the XY chart will only plot the true data points.

Hope this helps.
0 Kudos
Message 2 of 4
(3,202 Views)
Hi, Thank you very much Ian for the quick and helpfull answer! Another question on the same topic: Would it still be better to initialize the arrays if the max size these arrays can reach will be 65535 elements each? Or is it then better to use the Build Array function? Too hard to test this outside of test conditions and it will take hours to collect these 65535 data points. Thanks for any help/ideas, Madri
0 Kudos
Message 3 of 4
(3,202 Views)
Hi Madri

I can't give you a simple answer on this, I guess it also depends on what else your program is doing, maybe others can comment on likely performance.

What I would do is to create a test program using each method. Build your 18 XY plots using dummy data and monitor loop times in your program. You can then monitor process and memory performance in Task Manager.

Ian
0 Kudos
Message 4 of 4
(3,202 Views)