How Can I Implement An Hour Timer in LabVIEW?

Updated Dec 5, 2025

Reported In

Software

  • LabVIEW

Issue Details

I would like to develop a program where is required to count the time in hours. How can I implement this timer in LabVIEW?

The timers I know are in ms (milliseconds) or in s (seconds). I don't know if there can be another more effective way to do it.

Solution

One possible solution could be to use a Functional Global Variable (FGV) design pattern. This implementation computes the time difference, in each iteration, between the elapsed time and the initial time. When this difference is equal or greater than the target time, the VI stops.
 


However, FGVs are used as SubVI, therefore you have to implement a main VI that executes the FGV, as can be in the following image.
 
 
Please see the attach zipped file for how the above example is implemented.
 
The control Required Time is in seconds, therefore, if you are using hours you should perform the following conversion:
Hours = Seconds × 60 × 60


 

Additional Information

A Functional Global Variable (FGV) is a frequently used design pattern. An FGV is a non-reentrant VI featuring a while loop that iterates once, and has an un-initialized shift register. The purpose of this construction is to retain data between consecutive calls to the FGV.