LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting all data after loop iteration.

Solved!
Go to solution

How many times did you run the loop for your performance and memory test?

 

If just once, then you can clearly see the test_LED_PR...vi is taking 26 seconds to run. If you included timing statistics we would know how often it runs. However, you probably want to run it a few times with timing statistics checked.

0 Kudos
Message 11 of 16
(1,348 Views)

Hi majoris.

I apologize for my delay.

 

Here is my profil performance and memory test. I start my project and run "run main part of project" by pressing START BUTTON 3 times.

 

Thank you for your advice.

JJ

 

Edit: When I start project, this project is runing in whileloop. And when I push button "START BUTTON" project doing what I want. But when I don´t close all project and I want run my testing again by pushing "START BUTTON" It is slower, slower and slower. First time around 22 sec .. next time around 30s next time around 50 and more and more 😞 .

0 Kudos
Message 12 of 16
(1,334 Views)
Solution
Accepted by topic author Johnny_J

@Johnny_J wrote:

Here is my profil performance and memory test. I start my project and run "run main part of project" by pressing START BUTTON 3 times.


2 things are sticking out to me:

1. A LARGE portion of your time is spent in SWITCH_control.vi.  So what is happening in this VI?  You are creating 2 digital output tasks and writing to them all inside of a FOR loop that runs 36 times.  You are creating 72 tasks and not closing them!  That is a time killer right there.  Move the creating of the tasks to be outside of the loop and be sure to close them afterwards.  You can also simplify your code some by using an autoindexing tunnel instead of the Index Array.

 

2,  4xUUT_ovladani_pro_indikacni_LED.vi has a very wide difference in times between the shortest and longest runs.  And in that VI we see the same issues I mentioned for SWITCH_control.vi.

 

Attached is a cleaned-up version of SWITCH_control.vi.  I will leave the other one to you to clean up.

 

EDIT: I just noticed a third thing: DAQmx Create Channel  (DO-Digital Output).vi was called 1257 times.  The DAQmx Clear Task.vi was called 60 times.  That is nearly 1200 references you left open.  And I am not even counting the DI, AI, and AO tasks that should also be closed with the DAQmx Clear Task.  You need to do A LOT better at cleaning up your references.  I go back to what you really should be doing is open the tasks once at the start of your application and clear them as part of the application shutdown.  That just makes all of this simpler.



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
Download All
Message 13 of 16
(1,317 Views)

crossrulz

 

YOU ARE ABSOLUTLY AMAZING!

I do not know how long it took to you, but you've solved it.

Thank you very much!

Time is no longer prolonged when I run this "main part" a few times, but I will go through the program and check all the tasks.

 

I thank everyone who's been trying to help me here!

JJ.

 

0 Kudos
Message 14 of 16
(1,306 Views)

@Johnny_J wrote:

I do not know how long it took to you, but you've solved it.


Once I starting looking at your profile information, it took me about 1 second to notice the large amount of time in the first VI and maybe another 10 seconds or so to think about the shortest vs longest time comparison and notice the second VI.  Once I had a target VI to go after, it was a quick find.  My point being, this is why we ask for certain information: to try to pinpoint targets and then we can concentrate on that instead of trying to figure out everything.



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
Message 15 of 16
(1,297 Views)

crossrulz

Until now, I did not know it existed "profile performance and memory" tool.

Today I have gained a lot of new knowledge. And I thank you soo much for that.

JJ.

0 Kudos
Message 16 of 16
(1,288 Views)