From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Download All
Message 1 of 6
(12,245 Views)

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 6
(8,458 Views)

I love this!

0 Kudos
Message 3 of 6
(8,458 Views)

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 6
(8,458 Views)

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 6
(8,458 Views)

So I've always like the look and functionality of this timing probe and have been using it for years.  That being said Darren posted a nugget over here about how starting in 2016 there are probes that can work on all data types.  His probe worked great but didn't have the breakpoint functionality, or the aesthetics of this one, so I combined them.  It is saved in 2017 because I don't have 2016 to test with but it likely can be back saved.

Untitled.png

Message 6 of 6
(7,003 Views)