LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory problem using multiple graphs

Hi everyone,

I am using a dequeue element in a for loop to plot data [array of 250x4 dbl elements]. There are 6 different graphs [X,Y graph] in the case structure inside the for loop. The for-loop is placed inside a while loop, timed at 100ms [wait ms function]. When I run the loop for a certain amount of time [some minutes] the loop execution time increases to 110 ms, 120 ms and increases. The LP Data.LP1 array is initialized outside the while loop, and gets filled using the replace array subset function. I would like some second thoughts on my method of graph plotting, could this be the cause of memory leak? Would there be a more memory-efficient way of updating 6 different graphs simultaneously? 

Schermafbeelding 2018-03-19 om 18.19.48.png

The sub-VI:

Schermafbeelding 2018-03-19 om 18.20.57.png

 

Any feedback is welcome 🙂

San

 

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

We'll need some extra information; when you say "loop execution time increases", which loop are you referring to?  Have you included any additional benchmarking to isolate where the increase in time is coming from?

benchmarkcode.png

Also, keep in mind that there is a difference between using a Wait (ms) function and a Wait Until next ms Multiple function, mainly that the Wait (ms) adds on to the total loop time, which can be an issue if you have varying loop execution times.  Using a Wait until next ms multiple function gives you more consistent loop times.

0 Kudos
Message 2 of 3
(2,711 Views)

Hi,

The information in your post is a bit sparse to try and reproduce this - I mocked up the VI I've attached and I didn't see any slowdown in my case, but my guess is your data is more complicated, and it's further possible I misunderstood how your VI works - I wrote based on my best guesses from your description.

 

Does my VI show similar characteristics to yours? And if so, does mine slow down on your system? (You can replace "Untitled 2.vi" with your subVI).

 

If not, perhaps you can give a bit more information or a wider view of your VI.


GCentral
0 Kudos
Message 3 of 3
(2,702 Views)