06-08-2011 06:17 PM
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
06-08-2011 07:35 PM
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?
06-08-2011 07:58 PM
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 !
06-08-2011 07:59 PM
here's the new version of my program:
06-08-2011 11:08 PM
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
06-09-2011 01:26 AM
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
06-09-2011 01:37 AM
06-09-2011 04:18 AM
If it is possible to read all three channels of the power meter at once, then that should speed things up.
06-09-2011 03:10 PM
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
06-09-2011 05:54 PM
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 ??