Diagnostic SpaceWire Interface
EtherSpaceLink family User Manual
17.
6
.
2
9.
EtherSpaceLink_extract_timetag()
S
ynops
i
s
double EtherSpaceLink_extract_timetag ( EtherSpaceLink DSI_unit,
void *
buffer
)
D
esc
ri
pt
i
on
EtherSpaceLink_extract_timetag()
ext
r
ac
t
s
t
h
e t
i
me
-
t
a
g
f
r
om t
h
e
s
u
pp
l
i
e
d
pack
et
a
n
d
c
onve
r
t
s i
t
f
r
om
i
t
s i
nte
r
n
a
l
r
e
p
r
e
s
ent
a
t
i
on
a
s
a
n
i
nte
g
e
r
mult
i
p
le o
f a
b
a
s
e t
i
me (
1
00 n
s
) to
a
r
e
a
l
(
d
ouble) numbe
r r
e
p
r
e
s
ent
i
n
g
t
h
e t
i
me
i
n
s
e
c
on
ds
w
i
t
h a
r
e
s
olut
i
on o
f
t
h
e b
a
s
e t
i
me.
N
ote
:
t
i
me
-
t
a
gs
a
r
e ext
r
ac
te
d
b
y
t
h
is
f
un
c
t
i
on
f
r
om bu
ff
e
rs r
etu
r
ne
d
w
i
t
h
t
h
e
EtherSpaceLink_EXTN
te
r
m
i
n
a
to
r
a
n
d i
n
wh
i
ch
t
h
e
f
irs
t b
y
te
is
t
h
e v
a
lue
EtherSpaceLink_TimeTag & 0xFF
.
I
nput p
ara
mete
r
s
DSI_unit
t
h
e
ha
n
d
le
r
etu
r
ne
d
b
y a
s
u
cc
e
ss
f
ul
EtherSpaceLink_open()
c
omm
a
n
d
.
buffer
a
n
a
r
e
a c
ont
a
i
n
i
n
g
a c
ont
r
ol
pack
et
, s
u
ch a
s
t
ha
t
r
etu
r
ne
d
b
y
EtherSpaceLink_get_control_packet()
.
Retu
r
ns
double
t
h
e v
a
lue o
f
t
h
e t
i
me
-
t
a
g i
n t
h
e
pack
et.
E
xa
mple
bytes_received = EtherSpaceLink_read_packet_full
( DSI_unit, rxbuf, sizeof(rxbuf),
&terminator,
EtherSpaceLink_RETURN_EXTENSION_DATA
);
if (terminator == EtherSpaceLink_EXTN)
{
int extension_value = (int)rxbuf[0] & 255 | 256;
if (extension_value == EtherSpaceLink_TimeTag)
{
printf ("Time-Tag received: %.10fs0,
EtherSpaceLink_extract_timetag ( DSI_unit, rxbuf ) );
}
}
4Links Limited
www.4Links.co.uk
[email protected]
page 106 of 130
T +44 1908 642001; F +44 1908 363463
Milton Keynes MK3 6EB, UK
Suite EU2, Bletchley Park