LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What possible solutions are there for making a loop run faster?

Have you tried any of altenbach's suggestions? Let's really try to figure out where a majority of the slow code is happening from. Can you just take the histogram VIs and write to file VI and try them with synthetic data (create a new VI to test this). How does the communications portion of the loop respond without the histogram VIs? What are you computer specs? Is it essential to write to the file every loop iteration? Can you post-process your data or use a producer/consumer  architecture (see http://zone.ni.com/devzone/cda/tut/p/id/3023)?

 

Let us know what you find out and perhaps post your revised code.

Joshua B.
National Instruments
0 Kudos
Message 11 of 12
(407 Views)

I would also like to know what communication bus you are using. GPIB or serial? You are also transferring an awful lot of data with each loop. Is there possibly a built-in measurement function of the scope that you could use instead.

 

As a side note and nothing really with performance, I don't understand why you copied code from the driver and inserted it into your program. Leaving them as subVIs would not change the loop time. You've also got all of those different VISA Resource Name controls/locals for the same instrument. That's just silly.

0 Kudos
Message 12 of 12
(394 Views)