Specifications

Section 8. Processing and Math Instructions
8-15
IfTime
The IfTime instruction is used to return a number indicating True (-1) or False
(0) based on the datalogger's real-time clock.
See also TimeIntoInterval.
Syntax
IfTime (TintoInt, Interval, Units)
The IfTime function returns True (-1) or False (0) based on the scan clock.
Time is kept internally by the datalogger as the elapsed time since January 1,
1990, at 00:00:00 hours. The interval is synchronized with this elapsed time
(i.e., the interval is true when the Interval divides evenly into this elapsed
time). The time into interval allows an offset to the interval. The IfTime
instruction can be used to set the value of a variable or it can be used as an
expression for a condition.
The scan clock that the IfTime function checks has the time resolution of the
scan interval (i.e., it remains fixed for an entire scan and increments for the
next scan). IfTime must be within a scan to function.
The window of time in which the IfTime instruction is true is 1 of its specified
Units. For example, if IfTime specifies 0 into a 10 minute interval, it could be
true when the scan clock specified any time within the first minute of the ten
minute interval. With 0 into a 600 second interval, the interval is still 10
minutes but it could only be true during the first 1 second of that interval.
IfTime will only return true once per interval. For example, a program with a
1 second scan that tests IfTime(0,10, min) -- 0 minutes into a 10 minute
interval – each scan will execute the instruction 60 times during the minute that
it could be true. It will only return true the first time that it is executed, it will
not return true again until another interval has elapsed.
Parameter
& Data Type
Enter
TintoInt
constant
The time into interval sets an offset from the datalogger’s clock to the interval at
which the IfTime will be true. For example, if the Interval is set at 60 minutes, and
TintoInt is set to 5, IfTime will be True at 5 minutes into the hour, every hour, based
on the datalogger's real-time clock. If the TintoInt is set to 0, the IfTime statement is
True at the top of the hour.
Interval
constant
The Interval is how often IfTime will be True.
Units
The time units for TintoInt and Interval
Constant
Alpha Code Units
Usec microseconds
Msec Milliseconds
Sec Seconds
Min Minutes
Hr Hours
Day Days