
Section 8: Theory of operation
Series 3700A System Switch/Multimeter Reference Manual
8-22
3700AS-901-01 Rev. D/June 2018
Understanding Precision Time Protocol (PTP)
The Precision Time Protocol (PTP) is a time standard that does not have any discontinuities (that is,
no leap seconds, time zones, or daylight savings). This is important for computing time deltas
between events. Currently, the difference between PTP and UTC is 32 seconds.
The Series 3700A is not time-zone aware, just like your watch. For a stand-alone Series 3700A, PTP
= UTC = local time. However, things can get confusing if the Series 3700A is synchronized to a
device that is time-zone aware. The Series 3700A still presents UTC, but the other device presents
UTC ± offset as the local time, and so they will be different. As a result, you should always use PTP if
possible. Programs using PTP will work correctly, regardless of the presence of time-zone aware
devices.
The Series 3700A has two versions of time for most commands,
.seconds
and
.ptpseconds
,
which represent UTC and PTP time. Use the
ptp.utcoffset
value to move between the two times.
This value is zero unless the master clock populates it otherwise based on its information.
The following two statements produce the same value:
print(buffer.seconds[1] + ptp.utcoffset)
print(buffer.ptpseconds[1])
Example:
Run five scans once every hour starting at 3 a.m. tomorrow.
Assume tomorrow is Sept. 27, 2016. The first step is to convert the date and time to UTC format, and
then to PTP.
-- convert to UTC time
Start_time = os.time{year=2016, month=9, day=27, hour=3}
-- convert to PTP time
Start_time = Star ptp.utcoffset
Set up the alarm as follows:
schedule.alarm[1].ptpseconds = Start_time
schedule.alarm[1].fractionalseconds = 0
schedule.alarm[1].repetition = 5
––
1 hr = 60 sec.s x 60 mins
schedule.alarm[1].period = 60*60
schedule.alarm[1].enable = 1
Tie the above time event to a simple scan of DCV on channels 1 to 5 (in slot 1):
dmm.setconfig("1001:1005", "dcvolts")
scan.create("1001:1005")
-- 5 scans of 5 channels
buf = dmm.makebuffer(25)
-- initiates the scan start
scan.trigger.arm.stimulus = schedule.alarm[1].EVENT_ID
scan.scancount = 5
scan.background(buf)
The scan will initiate once the time condition is met. Check the scan progress with the following
command:
print(scan.state())