forked from M-Labs/artiq
examples/rtio_skew: show result in GUI
This commit is contained in:
parent
0ebe56f595
commit
9bfc2070d4
|
@ -1,8 +1,8 @@
|
|||
from artiq import *
|
||||
|
||||
|
||||
def print_failed():
|
||||
print("Pulse was not received back")
|
||||
class PulseNotReceived(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class RTIOSkew(AutoDB):
|
||||
|
@ -11,6 +11,12 @@ class RTIOSkew(AutoDB):
|
|||
ttl0 = Device()
|
||||
io_skew = Result()
|
||||
|
||||
@staticmethod
|
||||
def realtime_results():
|
||||
return {
|
||||
"io_skew": "raw"
|
||||
}
|
||||
|
||||
@kernel
|
||||
def run(self):
|
||||
with parallel:
|
||||
|
@ -21,6 +27,5 @@ class RTIOSkew(AutoDB):
|
|||
self.ttl0.pulse(5*us)
|
||||
in_t = self.pmt0.timestamp()
|
||||
if in_t < 0*s:
|
||||
print_failed()
|
||||
else:
|
||||
raise PulseNotReceived
|
||||
self.io_skew = out_t - in_t
|
||||
|
|
Loading…
Reference in New Issue