To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI demonstrates how to convert hours in decimal format (fraction of hours) to a string containing days, hours, minutes and seconds with units.
Description
Here is a brief description of the example:
The example uses Quotient & Remainder function to extract days, hours, minutes and seconds from the Hours value. The values are converted to strings and their units appended.
E.g.: 1225.576 displays as "51 days, 1 hour, 34 minutes, 33 seconds"
The Hours input value is in decimal format, e.g. 1.5 equals 1 hour and 30 minutes. The result is output as a string and as a cluster. The vi is called from a parent vi. You can easily change the input from hours to seconds if need be as long as the unit of the values fed into the for loop is seconds
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**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.