04-12-2017 09:35 AM
Is there a "canned" routine for Labview ( 2014) to determine 6 months from a date entered or do you have to write your own?
The User wants to put in a date for calibration purposes and know when 6 months are up.
Thanks..
04-12-2017 09:40 AM - edited 04-12-2017 09:41 AM
04-12-2017 09:56 AM
Of course if the running program is supposed to notify the user six month from now that a calibration is due, the last calibration date would need to be written to a file (or cloud location) so it survives reboots and program restarts. It would also need to check the file on restart, maybe the date has already been long passed due to downtime.
There is probably also an API to e.g. add the next calibration date to google calendar or similar.
04-12-2017 10:06 AM
That's what I initially had. They complained ( maybe I didn't explain well enough) that they want "6 months from the current date". Not 180 days. So 6 months from today April 12, 2017 would be October 12, 2017....Six months from October 12, 2017 would be April 12, 2018..etc.
Thanks..
I do write to a text file the cal date then read it back when ( before) the Test is run.
04-12-2017 10:19 AM
There are a pair of functions on the Timing Palette, Date/Time to Seconds and Seconds to Date/Time, that convert from LabVIEW's TimeStamp (here called "seconds") into a cluster they call a "Date/Time Record", which has numeric fields for Month, Day, Year, and a bunch of other things. So you can take a TimeStamp for Today (the default, "unwired" output of Get Date/Time in Seconds), do Seconds to Date/Time, add 6 to the Month part of the Cluster, run it through Date/Time to Seconds, and have a TimeStamp for "six months from now".
By giving you "100 words" instead of a Picture, I'm hoping you'll try this and learn about these functions. Use "Help" if you need to on the functions.
Bob Schor
04-12-2017 10:52 AM
@Bob_Schor wrote:
add 6 to the Month part of the Cluster, ...
Most easily done using the "in place element structure". :D)