Example Code

Implementing a Timeout Using the Elapsed Time VI in LabVIEW

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 use the Elapsed Time Express VI to implement a timeout case in an overall application.

 

Description

This VI demonstrates how to use the Elapsed Time Express VI to implement a timeout case in an overall application. You have the option to either manually reset the timeout based on an event firing (in this case asserting the boolean switch on the front panel) or it resets when the timeout value has been reached.

 

Requirements

LabVIEW Base Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Enter the Timer Timeout (s) value in seconds
  2. Run the VI
  3. Notice that the Timeouts value increase whenever the time elapsed passes the Timer Timeout
  4. Press the Reset switch to restart the timer and increment the Number of Resets by 1

 

Additional Information or References

Note that elapsed time is being polled as is not execution timing (makes the While Loop sleep) therefore the Wait (ms) is necessary in the application

 

VI Block Diagram

 4403.PNG

 

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

Jonah Paul
Marketing Manager, NI Software

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

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting! Could you please rename your attachment to include the LabVIEW version ("_lvXX.vi" is fine).  Also, please include a screenshot to give us an idea of what we're downloading.

Todd S.
LabVIEW Community Manager
National Instruments