Benchmarking a portion of LabVIEW code

Publish Date: Sep 06, 2006 | 0 Ratings | 0.00 out of 5 | Print | Submit your review
This VI provides 2 methods for benchmarking the execution time of a portion of LabVIEW code.

Method 1: Using counter

To use this method, you will need to have a DAQ board with a counter inside. You can program the counter to count edges on the counter source signal (by default, the 100kHz timebase of the device). The counter value is initialized to 0, then, the portion of code is executed. At the end, the count value is read. Based on the known frequency of the source signal, we can calculate the time elapsed after the execution.

Method 2: Using software timer

To use this method, you do not need to have a hardware device. This method is software-timed but it is less accurate than the first method. You read the initial and final timestamp with the "Tick Count" VI of LabVIEW.

Each method is based on a state machine with 3 states:
1. "Start" to get the initial timestamp
2. "Run" to execute the code to benchmark
3. "Stop" to get the final timestamp and calculate the execution time

To run this VI:

1. Select the method to use by selecting the correct page in the tab control
2. Add your code to benchmark in the diagram (step "Run" of the state machine)
3. Run the VI

Back to Top

Bookmark & Share


Downloads

Attachments:

BenchmarkVI_Example.vi

Requirements


Ratings

Rate this document

Answered Your Question?
Yes No

Submit