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

Continuously Incrementing Stopwatch Timer Using Timed Loops

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 continually counts upwards, in either millisecond or second increments.


Description
The goal of this VI is to provide a continual reference timebase for an application. It is very similar to the Tick Count (ms) function, but it always starts at 0, and does not "wrap" back to 0 when the 32-bit limit is hit. The timer is fairly accurate, but still could suffer some determinism issues. The boolean LED is lit if the software skips a cycle, throwing the count off slightly.


Requirements

Software:

  1. LabVIEW 2012

 

Steps to Implement or Execute Code

  1. Choose the unit of time (milliseconds or seconds)
  2. Run the VI

 

Additional Information or References
NI Snippet

1.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.