cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Simple, Sexy LabVIEW Timing Probes

Simple, Sexy LabVIEW Timing Probes

Problem

I'm really tired of dropping sequence structures, timing VIs, subtract functions and creating indicators, just to get an idea of the execution time of a VI or portion of a VI.

old+school+timing.png

I'm spending 30 seconds doing this, and then another 30 ripping it out of the VI once I'm done. I want my minute back.


Solution

I just drop the timing probes along my error wire, and see the dt between the execution of the probes. I usually have error wires at least enforcing data flow throughout my VIs.

new+school+timing.png

3 seconds of setup, 0 seconds of cleanup (just close the VI or probe window). 97% success.


Installation and Basic Use

  1. Place the attached probes in <LabVIEW Data Directory>\Probes
    • Data Directory Path can be found in LabVIEW by navigating to Tools»Options»Paths.
  2. Place the probes on error wires around the sections whose timing you care about.
  3. Mark the first executed probe as t0 (optional).
  4. Execute your code and view the results in the probe window(s).


A Few Extra Details

  • Tab 1 shows you the elapsed time since the previously executed probe.
    • Mark a probe as t0 to just ignore the bogus value returned (the first probe can't have a dt). Check the t0 check box to do this.
  • Tab 2 lets you set a conditional breakpoint, based on whether or not the dt was greater than a particular value.
  • The time deltas are based on execution order of the probes, not on placement order.
  • The microsecond version of the probe only works on Windows.
    • Obviously, take the microsecond values with a grain of salt, since we are talking about Windows, here. Useful for an order-of-magnitude idea of sub millisecond execution times.
  • Probes are compiled for LabVIEW 8.6 or later.



Evan Prothro
RF Systems Engineer | NI

Message 1 of 5
(5,073 Views)

Re: Simple, Sexy LabVIEW Timing Probes

You should consider using VIPM (http://jki.net/vipm) to package your probes in a VI Package to make it easier to distribute them.  An example of this was done by Saphir's VI Box Probes:http://decibel.ni.com/content/groups/saphir-toolkit/blog/2010/11/18/set-of-custom-probes

BTW - The Saphir VI Box probes include some timing probes that are similar to yours.

0 Kudos
Message 2 of 5
(1,286 Views)

Re: Simple, Sexy LabVIEW Timing Probes

I love this!

0 Kudos
Message 3 of 5
(1,286 Views)

Re: Simple, Sexy LabVIEW Timing Probes

If you stick the Enqueue Event inside the t0 case structure, you can have all the other probes give the time relative to a specified point on the BD, rather than having to guess what order they execute in.

*EDIT* You also have to manage the queue differently (i.e. preview queue) or use some other method to pass data around.  Same general concept, though.

0 Kudos
Message 4 of 5
(1,286 Views)

Re: Simple, Sexy LabVIEW Timing Probes

Nice feature and seems to work well at first but during my second try, after stopping and running my VI again without removing the probes, I got a continuous stream of error pop-ups (something to do with the Queue reference) that were really hard to stop and ultimately had to kill LabVIEW who was stuck at 100% CPU even after I succeeded at stopping my test VI.   Be careful if using that tool that you save your code previously! They can be helpful though. I think that the Probes from Saphir (Free on the Tools Network) are more reliable.

0 Kudos
Message 5 of 5
(1,286 Views)