LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I simply increase the speed of my loops?

Greetings all,

I am running a loop that is collecting data off photon counters (through a pass counter installed in a VXI module). When I set the execution properties (in the VI properties window) to highest, and I gut my loop of any extraneous calculations, it still doesn't run as fast as I would like. Any suggestions? Thanks.
0 Kudos
Message 1 of 5
(2,908 Views)
Your code may not be as optimozed as it can be. You might be doing unnecessary front panel updates. You may be making data copies. There are lots of possibilities. There are also experts who squeeze the most out of LabVIEW every day. We're called Alliance Members. Some of us even have Certified LabVIEW Developers (like me) on staff. Contact one of us, and we may be able to make your loops run faster.

Otherwise, get a faster PC! 🙂

Daniel L. Press
PrimeTest Corp.
www.primetest.com
0 Kudos
Message 2 of 5
(2,908 Views)
The problem may be a software bottleneck or a hardware bottleneck.
Some potential software problems:
(In addition to unneccessary front panel updates and data copies mentioned by Alliance member PhotonDan)
Are you writing your data to arrays? If so, how do you initialize and build the array? Performance on a fixed array is much better than on an array that keeps growing.
Are you using property nodes when local variables would do? Are you using property nodes or local variables when wires or shift registers would do?
When you communicate with your instrument, are you doing unneccessary initializations or opening and closing refnums or handles, etc, on every call?
Click here to view a previous Web Event on optimizing VI performance for more ideas.
Some possible hardware bottlenecks:
(In addition to a slow PC mentioned by Alliance member PhotonDan)
What's the connection between the PC and the VXI mainframe? Is it an embedded slot 0 controller? GPIB? MXI?
How fast does your instrument respond?
Can you tell if your hardware is waiting on your software or vice-versa?
Message 3 of 5
(2,908 Views)
Al S,

Thank you for your suggestions. Currently I am loading three channels of information from the counters into a 1-D array, then auto-indexing that array into a 2-D array (which is outputted into a txt file OUTSIDE of the loop).
I tried using an initialized array in conjunction with shift registers, but I did not see any increase in my loop times.
There is definately no hardware bottleneck; the counters can read well into the order of MHz, and I am having trouble exceeding 10 or 15 KHz with regards to LabVIEW checking the counts.
I will take a look at that "Web Event." Thanks for the link.

Nick
0 Kudos
Message 4 of 5
(2,908 Views)
Your instrument may be very fast, but communication with it won't be so fast. The data needs to go across some kind of bus to get to the PC. Communication is often the bottleneck in test and measurement applications.
Windows is also partly to blame for performance problems. Windows is multi-tasking and not a real-time operating system. Your program has little control over what else Windows is doing. If multi-tasking is a big part of your problem, you may see some improvement if you increase the priority of your VI. From the VI's menu bar, goto File >> VI Properties >> Category >> Execution >> Priority >> High, or Time Critical. Just remember that increasing your VIs performance will hurt the performance of any other app running on that PC.
Look
ing at the Windows timers helps put into perspective how fast Windows expects to reliably perform any task. The resolution of Windows timers is 1 mS. This doesn't directly relate to your application, but I think it gives some perspective. If the Windows timers were capable of doing anything in the MHz range, the timer resolution would need to be nano-seconds, not milli-seconds.
0 Kudos
Message 5 of 5
(2,910 Views)