NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Checking for calibration time

Solved!
Go to solution

I have a requirement to perform a daily calibration of an instrument on a daily basis.  The time of calibration must be user configurable.  So, what I have done is created a menu item which allows the operator to control the user time.  Additionally, I have a file where I store the last calibration time.  So, in my routine, I perform the calibration if it has been more than 1 day since the last calibration or the current time is greater than the daily set calibration time.   For the latter condition, there is always a possibility that calibration could get performed before the 24 interval is up ie:  initially, the daily calibration time was 9pm and then the operator decided to change it to 8am the following morning, so calibration would get run after 11 hours.

However, if I implement the OR condition as follows :

Current Time > Calibration Set Time ||  Current Time is 1 day older than last calibration time, I run into the problem that the calibration will be executed every time the current time > calibration set time, whereas I only want the calibration to be run once if the time has been changed.  I am struggling with the logic of how to implement it.  I am looking to the experts or the forum to help me overcome the intellectual roadblock right now.

0 Kudos
Message 1 of 2
(3,229 Views)
Solution
Accepted by kerugoya

You could store in the file the next "Expected Calibration" time.  This would be set whenever the user updates the test station.  This could also be set whenever a calibration is performed (whenever the calibration is performed, set it to 24 hours from now, or the next expected calibration time).  You would only need to check if the current time is greater than the Expected Calibration Time.

0 Kudos
Message 2 of 2
(3,218 Views)