Example Code

Elapsed Time Functional Global in Custom Format

Code and Documents

Attachment

Overview:
This VI is a modification in the elapsed time functional global by outputting the time in a custom numerical format.
Description:

The double output is in the following format:  MM.SS.

 

For example, 1.10 is 1 minute 10 seconds.  0.56 is 0 minutes 56 seconds.  This is done by converting the appropriate unit values into strings and concatenating the string results into the custom format.  The final string is converted back to a double value.

Requirements:

  • LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code:

  1. Use the initialize action to reset the elapsed timer.
  2. Use the Get Elapsed Time function to retrieve the formatted time result.

 Additional Information or References

 

 

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

Comments
tstahl
Member
Member
on

That's a lot of effort to convert the time as the numeric control can be formatted to display a relative time including the delimiter between minutes and seconds.

Tim

John Gracki
Member
Member
on

This is quite helpful for temperature, time statistics.  We have some boil-sense operations that require a timer resolution of 1/10th of a minute and VI time stamps have been combined in minutes and seconds, making manual conversion quite difficult for repetitive statistical operations requiring the single unit of measure.  Thanks for the tip and the VI.