12-04-2008 03:54 PM
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?
12-04-2008 06:14 PM
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.
12-04-2008 06:36 PM