2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

examples/rtio_skew: show result in GUI

This commit is contained in:
Sebastien Bourdeauducq 2015-01-30 19:07:51 +08:00
parent 0ebe56f595
commit 9bfc2070d4

View File

@ -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:
self.io_skew = out_t - in_t
raise PulseNotReceived
self.io_skew = out_t - in_t