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

Increasing Delay within a State Machine

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
Coding that exemplifies how to increase a delay time on a state machine.

 

Description

This example is a proof of concept for an application in which a device would need to be turned on and off. The device would initially be on for 5 seconds. The next time it turns on it will be on for 5.1 seconds, the next time 5.2 seconds and so on until it reaches a 10 second on duration, at which point the program ends.


Be patient with the Stop button as an "on" cycle must complete before the program ends.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Select the Run button.
2. If desired, stop the application with the Stop Button.


Additional Information or References

Capture.PNG

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