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.

Example Code

LabVIEW - Software Timing vs Execution Timing

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI shows the key advantage of using software timing over execution timing - maintaining responsiveness while timing a task.

 

Description

Execution Timing:

We can use functions like "Wait (ms)" and "Wait Until Next mx Multiple" to control the execution speed of our LabVIEW VIs - this could be to set the rate of a loop or introduce delays to allow instruments to respond to a command.

 

Software Timing:

Software timing is used when we want a process to run for a given period of time.  The VIs we use for this are the Elapsed Time Express VI, or we can create a functional global variable and use "Get Date/Time in Seconds".

 

Example:

Take a look at the attached VI to see the key advantage of using software timing over execution timing - maintaining responsiveness while timing a task.  Both loops perform the same function - waiting for 10 seconds before displaying a dialog.  Note that the software timed version can be interrupted, however the execution timing can't.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Run the VI.
  2. Click on STOP button of the two timing, and can see that the software timed version
    can be interrupted, however the execution timing can't.

 

Additional Information or References

Front Panel

2.PNG

 

VI Snippet

1.png

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.** 


Regards,

Peter D

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.