LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My program execution is too slow

Hello world !

i'm new on LabView, but i'm trying to improve my skills and my question is the next one: what are the "technics" to increase the speed execution of a program ?

 

My problem:

I have 3 optical tunable filters, but these filters drift, for exemple: if my filter submit a maximum power of 23uW for a voltage of 2.5V at a certain time, a couple of hours later, it will submit the same power but for a voltage of 2.7V.

I have then programed a feedback/control system (thanks to a PID controller). When i do the experiment for one filter only, everything works perfectly. When two filters are connected in series, the system slows down but it is not a big deal. The problem is when 3 filters are connected in series. They do exactly what i want them to do but everything is SO slow ( more than a second per cycle) and this is a big issue for what i want to do with it.

You can find my program attached for more details.

Thank you so much for taking the time to read me. i hope my explanation has been clear enough,

and sorry for my bad english !!

 

Best wishes,

 

Yanis

0 Kudos
Message 1 of 11
(3,116 Views)

Hi Yanis

 

You forgot to attach your power meter vi.

 

You might want to check on the process flow of those 3 filters.

The 3 while loops, are they execute at the same time?

or one by one?

0 Kudos
Message 2 of 11
(3,108 Views)

Hi kakashi! 🙂

 

i don't know what you mean by "checking the process flow of the filters"...

for the power meter, i mesure it with the waveform charts and the "reading control"

i have deleted the loops to use only one. but it doesn't change anything on the execution speed...  

 

thanks for your answer !

0 Kudos
Message 3 of 11
(3,104 Views)

here's the new version of my program: 

0 Kudos
Message 4 of 11
(3,103 Views)

I cant run your VI as i dont have HP8153aRead.vi

 

 

Click on the Highlight button.

Then run your program.

Check that are they run in parallel in those 3 while loops that you have created?

or they run first loop follow by second loop and third loop

0 Kudos
Message 5 of 11
(3,095 Views)

The sequence structure is reduntant, you can remove it. You never close the visa resources after the loop. I'd split the loop to 3 separate loops. There's no wait in the loops probably causing the cpu to spin wildly and/or too hard strain on the daq-express-vi's.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 11
(3,087 Views)

I'd also r-click the Express vi's and convert them to daq-mx-code and work from there. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 11
(3,086 Views)

If it is possible to read all three channels of the power meter at once, then that should speed things up.

 

0 Kudos
Message 8 of 11
(3,072 Views)

First of all i would like to thank you for all your answers!

I tryed all the sollution you proposed but nothing has really changed it speed. 

 

1° The loops are not running in parallel, would it be faster if they were ? how do i make them run in parallel ?

2° the sequence structure was indeed reduntant, everything work nicely even without it!

3° closing the Visa sources after the loop doesn't make the program executes faster..

4° 3 seperate loops instead of one doesn't make a huge difference ... 

5° Waits/Delays doesn't make the system faster (or maybe i didn't know how to use it propoerly!)

6° What do you mean by "convert the Express vi's to DAQmx code and work from there" ??

 

i have no ideas how i'll solve this problem, any comment or remark are very welcom !

 

Thank you again for your help!

 

Yanis

0 Kudos
Message 9 of 11
(3,042 Views)

i have actually found where my problem is!

the vi called HP8153A slows down the program A LOT, this vi is used as a power metter and deliver it value to the PID. 

Do you think there is a way to exclude it from the loop and still be taking its different values ??

0 Kudos
Message 10 of 11
(3,020 Views)