Example Code

FGV Timer with Multiple Pause & Autoreset

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 Demonstrates how to act as a functional global variable (FGV) with multiple capability and auto reset.

 
Description
Here is a brief description of the example:

To initialize/start the timer, the reset state must be called.  Pause can be called multiple times during operation, and this FGV keeps track of the total pause time to adjust the elapsed time value.

 

Requirements

  1. LabVIEW 2013 (or compatible)


Steps to Implement or Execute Code

  1. Run the VI with the input State set to "reset".  This will begin the timer.
  2. Run the VI with the input State set to "read".  This will read the elapsed time since the "reset" state was called.
  3. Run the VI with the input State set to "pause".  This will pause the timer.
  4. Run the VI with the input State set to "unpause".  This will start timing again and determine an adjustment to make to the elapsed time.

 

Additional Information or References

VI Snippet

FGV Timer 2013 NIVerified.png 

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

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