User manual
Series 3700 System Switch/Multimeter Reference Manual Section 11: LXI Class B Triggering (IEEE-1588)
3700S-901-01 Rev. C / July 2008 11-5
Scheduling alarms
You can schedule alarms to request the Series 3700 to perform actions at a
specific time and date or at a specific time interval. You can schedule alarms in
UTC or PTP time; however, it is important to be consistent in defining the alarms
using the same time format whether UTC or PTP. Otherwise, the alarms will fire
on the networked devices at different times, with a time difference equal to the
PTP UTC offset.
You can set a maximum of two alarms per Series 3700.
To schedule an alarm, first convert the desired alarm time to UTC seconds. You
can perform this conversion using os.time. If you are specifying alarms in UTC
time, then you can use this value with schedule.alarm[x].seconds (on
page 13-251) to schedule an alarm, where x represents the tag number of the
alarm that you configure.
NOTE os.time is a LUA function that can be used to return the current time
or convert a local date and time to UTC-based seconds elapsed since
January 1, 1970. When used without parameters, os.time returns
the current date and time. When used with parameters, the syntax is
os.time{year = <n>, month = <n>, day = <n>, hour =
<n>, sec = <n>, isdst = <b>}. <n> is a number and <b> is a
Boolean where true is Daylight Savings Time. It is not necessary to
specify all parameters.
The following examples demonstrate how to use os.time:
-- retrieve current UTC time in seconds since 1/1/1970
print(os.time)
-- convert 3:00PM March 1, 2008 to UTC seconds since
1/1/1970:
local l_start_Time
l_start_Time = os.time{year=2008, month=3, day=1, hour=15}
-- create start time to occur 60 seconds after current time
local l_start_Time
l_start_Time = os.time() + 60
If you want to specify alarms in PTP format, convert UTC seconds to PTP
seconds by adding the value returned by ptp.utcoffset (on page 13-229) to
the UTC time. The Series 3700 alone does not differentiate PTP and UTC time.
The ptp.utcoffset is only non-zero if the Series 3700 communicates to a
master clock that is aware of the difference between PTP and UTC time. Use
the converted PTP time in setting values for
schedule.alarm[x].ptpseconds (on page 13-251), where x represents the
tag number of the alarm you configure.