
Timestamps
General information
(c) Spectrum Instrumentation GmbH
157
Timestamps
General information
The timestamp function is used to record trigger events relative to the beginning of the measurement, relative to a fixed time-zero point or
synchronized to an external reset clock. The reset clock can come from a radio clock, a GPS signal or from any other external machine.
The timestamp is internally realized as a very wide counter that is running with the currently used sampling rate. The counter is reset either
by explicit software command or depending on the mode by the start of the card. On receiving the trigger event the current counter value is
stored in an extra FIFO memory.
This function is designed as an enhancement to the Multiple Recording mode and is also used together with the Gated Sampling and ABA
mode, but can also be used with plain single acquisitions.
Each recorded timestamp consists of the number of samples that has been counted since the last
counter reset has been done. The actual time in relation to the reset command can be easily calcu
-
lated by the formula on the right. Please note that the timestamp recalculation depends on the cur
-
rently used sampling rate. Please have a look at the clock chapter to see how to read out the
sampling rate.
If you want to know the time between two timestamps, you can simply calculate this by the for
-
mula on the right.
The following registers can be used for the timestamp function:
Writing of SPC_TS_RESET and SPC_TS_RESET_WAITREFCLK to the command register can only have an effect on
the counters, if the cards clock generation is already active. This is the case when the card either has already
done an acquisition after the last reset or if the clock setup has already been actively transferred to the card
by issuing the M2CMD_CARD_WRITESETUP command.
Table 91: Spectrum API: timestamp related register and available timestamp commands
Register
Value
Direction
Description
SPC_TIMESTAMP_STARTTIME
47030
read/write
Return the reset time when using reference clock mode. Hours are placed in bit 16 to 23, minutes are
placed in bit 8 to 15, seconds are placed in bit 0 to 7
SPC_TIMESTAMP_STARTDATE
47031
read/write
Return the reset date when using reference clock mode. The year is placed in bit 16 to 31, the month
is placed in bit 8 to 15 and the day of month is placed in bit 0 to 7
SPC_TIMESTAMP_TIMEOUT
47045
read/write
Set’s a timeout in milli seconds for waiting of an reference clock edge
SPC_TIMESTAMP_AVAILMODES
47001
read
Returns all available modes as a bitmap. Modes are listed below
SPC_TIMESTAMP_CMD
47000
read/write
Programs a timestamp mode and performs commands as listed below
SPC_TSMODE_DISABLE
0
Timestamp is disabled.
SPC_TS_RESET
1h
The counters are reset and the local PC time is stored for read out by SPC_TIMESTAMP_STARTTIME and SPC_TIME
-
STAMP_STARTDATE registers. Only usable with mode TSMODE_STANDARD
SPC_TSMODE_STANDARD
2h
Standard mode, counter is reset by explicit reset command SPC_TS_RESET or SPC_TS_RESET_WAITREFCLOCK.
SPC_TSMODE_STARTRESET
4h
Counter is reset on every card start, all timestamps are in relation to card start.
SPC_TS_RESET_WAITREFCLK
8h
Similar as SPC_TS_RESET, but aimed at SPC_TSCNT_REFCLOCKxxx modes: The counters are reset then the driver
waits for the reference edge as long as defined by the timestamp timeout time. After detecting the edge, the local PC
time is stored for read out by SPC_TIMESTAMP_STARTTIME and SPC_TIMESTAMP_STARTDATE registers. Only usable
with mode TSMODE_STANDARD
SPC_TSCNT_INTERNAL
100h
Counter is running with complete width on sampling clock
SPC_TSCNT_REFCLOCKPOS
200h
Counter is split, upper part is running with external reference clock positive edge, lower part is running with sampling
clock
SPC_TSCNT_REFCLOCKNEG
400h
Counter is split, upper part is running with external reference clock negative edge, lower part is running with sam
-
pling clock
SPC_TSXIOACQ_ENABLE
1000h
Enables the trigger synchronous acquisition of the multi-purpose inputs with every stored timestamp in the upper 64
bit. See Multi-purpose I/O chapter for details on these inputs.
SPC_TSFEAT_NONE
0
No additional timestamp is created. The total number of stamps is only trigger related.
SPC_TSFEAT_STORE1STABA
10000h
Enables the creation of one additional timestamp for the first A area sample when using the optional ABA (dual-time
-
base) mode.
SPC_TSFEAT_TRGSRC
80000h
Reding this flag from the SPC_TIMESTAMP_AVAILMODES indicates that the card is capable of encoding the trigger
source into the timestamp.
Writing this flag to the SPC_TIMESTAMP_CMD register enables the storage of the trigger source in the upper 64 bit of
the timestamp value.
t
Timestamp
Sampling rate
----------------------------------------------------------
=
t
Timestamp
n
1
+
Timestamp
n
–
Sampling rate
-----------------------------------------------------------------------------------------------------------------------------
=
Содержание M2p.59 Series
Страница 190: ......