05-11-2012 04:37 AM
Hello
I'm facing a problem and can't get to a good solution.
I want to calculate how many days there are still left until a certain date.
This is because I want to build in a reminder to re-kalibrate the hardware that is used every year.
So if it's today 11-5-2012, and the constant is 21-05-2012 labview has to calculate there are still 10 days left before the re-kalibration has to be finished.
Anyone has got an idea how to make this?
Thanks in advantage!
Solved! Go to Solution.
05-11-2012 04:48 AM
sure, remember that time stamps are DBL in seconds.
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-11-2012 05:46 AM
You can use formatting to control the presentation of a value. Leave the units as seconds and set the properties of the indicator to use relative time with a format of %<%D>t. The value on the wire will continue to be in seconds, but the front panel will display the equivelant number of whole days.
You can also apply units to simplify the readability of your code; but be aware that once you apply units to a control or indicator the units propogate (down the wire) and that LabVIEW will check for incompatible units. This can sometimes lead to strange results or cause a sub-vi to report as broken without any obvious problem.
If you convert a unitless number to a specific physical group using Build Unit String and then convert it again to the same physical group with different units, the wire will revert to unitless but the value will be in the specified units. In the example below, the value for days would be whole days and fraction of a day.
http://thinkinging.com/2007/06/08/labview-tip-easy-relative-timestamp-calculations/
http://thinkinging.com/2007/06/25/labview-tip-easy-unit-conversion/
05-11-2012 06:13 AM
I'm just kidding. I was playing around with SQLite date queries yesterday 😄