Example Programs

Showing results for 
Search instead for 
Did you mean: 

FGV Timer SubVI

FGV Timer 2012 NIVerified



This Timing VI can be called within a main application to start, get value, pause, and resume.



The values are stored in a functional global variable (FGV) within a loop that is called only once. Each time you call the subVI, you can input a enum state in order to start the timer, get the elapsed time, pause or resume the timer. The timer also outputs the Elapsed time, a Boolean indicator comparing the elapsed time to the target time, and a pause flag to notify the user if the timer is paused.


  • LabVIEW 2012 or compatible


Steps to Implement or Execute Code

  1. You can run the subVI on it's own by selecting the enum input for timer state and pressing run. It is designed to run the loop only once since it is designed to run as a subVI. For testing purposes, you can run the VI continuously to keep the values on the front panel updated.
  2. Use this VI as a subVI. Within a state machine, you can start the timer in one state and get the time in another state.

Additional Information or References

front panel 





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




Applications Engineer
National Instruments
Member Greg_Reynolds

Thanks for this fgv timer example.  I enjoyed reviewing it's functionality as I study for the CLD.  I made a few changes and posted here.

Greg R.
Member Ahmed_Osman

Thank you for sharing.


I've made a minor modification:

  1. add start time option "so that you start counting from known value when needed not 0"
  2. removed the type definition

 timer v2.png