LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xy plot performance

Hi all,

I have a question regarding the performance of xy graph vs a chart. In my project i have been using a chart (Ichart history length to 24000pts) to plot 4 signals at a rate of 10Hz with no effect on the performance of my program. I recently switched to using an xy graph with the same conditions (I havent set an array size) and my  program slows down then locks up after about 1hr of running. I have attached a picture of the method which i am using to update the xy graph.

The VI has 3 main loops.

A UI loop with a event structure to handle user events running at 5Hz.

Data logging loop running at 10Hz (a subvi runs flat out every 100ms dumping data from a buffered network shared variable to file).

Display Loop updating charts and indicators (data is recieved via a network shared variable).

 

So, why does the chart perform so much better than the xy graph and can I get the xy graph to perform similarly?

 

0 Kudos
Message 1 of 3
(2,759 Views)

It is not clear from you graphics what you are doing. It seems a lit of crucial code is missing. Where is the databuffer?

 

Can you attach a real and functional VI instead?

 

From what I can tell you are using insert into array to build all the plot, constantly dancing between different data types (cluster, array, back to clusters, etc). Each resizing operation forces a new copy in memory. Not good!

 

What you need to do is allocate a fixed size array (initally all NaN) and operate on the data "in place" by replacing data. See how far you get.

0 Kudos
Message 2 of 3
(2,741 Views)
You have to remember, you are rebuilding the graph every time you update it. The chart is designed to update as you add points to the chart, not a complete rebuild.
0 Kudos
Message 3 of 3
(2,735 Views)