01-29-2009 10:03 PM
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.
01-29-2009 11:13 PM
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.