Hi John,
I have drawn a picture to illustrate my recommended timestamping
method. I have labeled the events A-E, and numbered the samples to
describe what I think you might be seeing. I have made an assumption
that each record is 3 samples as an example and have outlined those
records. Triggers are red and initial samples are blue. The end goal
is to get the time between the red triggers (B-A and D-A), however we
cannot capture the time of the start trigger, and will substitute the
time of the first sample (A' will replace A).

A = Start Trigger
B = Reference Trigger 0
C = First Sample for Record 0
D = Reference Trigger 1
E = First Sample for Record 1
The board will begin sampling after the start trigger occurs. If you
set your pointer and number of samples to read to 1 sample relative to
start, sample 1 will be returned with an absolute timestamp of A'.
Your timing error is A-A' which can be up to 1 sample period. This time
is used as a reference point and should not be included with your bins,
this is just a marker to represent the beginning of bin 1.
Now changing those properties to read the appropriate record # (0),
samples per fetch (3) and to read relative to pretrigger, you will
fetch samples 5,6 and 7. Your absolute time is C. Your relative time
is C-B. Therefore the absolute trigger B is given by C- (C-B).
Incrementing your record to fetch (1) you will get samples 11-13. Similarly you will calculate D as E-(E-D).
Finally you will get your relative trigger times as B-A' and D-A'. If you are
already implementing this, and your triggers B, D, F, H..... are not
periodic even though you provide a periodic wave could you post a code
snippet? I expect B-A' to vary as the signals are not synchronized,
but B&D should never have reason to fall on top of one another.
Message Edited by Jennifer O on
07-18-2008 01:45 PM