From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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

Tick Count Elapsed Time to Timestamp Using 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

Download All

Overview

This VI can be used to calculate the time between two tick counts and it will return the data in a timestamp data type.

 

Description

The tick counts are subtracted and then the days, hours, minutes, seconds, and fractional seconds are calculated. The result is turned into a timestamp data type. The time is checked to see if the time has exceeded the update interval and the Elapsed Time output is updated.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Run the VI.
2. Observe elapsed time as days, hours, minutes, seconds and milliseconds.

 

Additional Information or References


2012.png

 

 

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

 

Steve B

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

Comments
PhillipBrooks
Active Participant
Active Participant
on

There is a nice function in the vi.lib/Utility folder that will return a high resolution time. This was added in LV 2010.

http://forums.ni.com/t5/LabVIEW/New-LV2010-VI-High-Resolution-Relative-Seconds/td-p/1213011


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness