Example Code

Continuously run a task that starts and stops at specified times

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

Overview

This example demonstrates how to continuously run a task that starts and stops at specified times.

 

Description

This program continuously checks if current time is greater / equal than a specified start and stop time. A specific task is triggered continuously after start time is reached. This layout can be used to perform any task continuously for a certain amount of time. Just place the task to be performed inside of the case structure. The task will run until the stop time is reached or the user presses stop.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)

 Hardware

  • No hardware required

 

Steps to Implement or Execute Code

  1. Download the attached file "Trigger task at start stop time LV2012 NIVerified.vi"
  2. Open VI and follow the instructions in Front Panel and Block Diagram and run the program.

 

Additional Information or References

Trigger task at start stop time LV2012 NIVerified.vi - Front Panel.png

 

Trigger task at start stop time LV2012 NIVerified.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Regards,
Jim Schwartz

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