artiq/artiq/examples/kasli_sawgmaster/repository/sines_2sayma.py

38 lines
968 B
Python
Raw Normal View History

2018-06-22 18:57:49 +08:00
from artiq.experiment import *
class Sines2Sayma(EnvExperiment):
2018-06-22 18:57:49 +08:00
def build(self):
self.setattr_device("core")
self.sawgs = [self.get_device("sawg"+str(i)) for i in range(16)]
@kernel
def drtio_is_up(self):
2019-12-21 14:17:52 +08:00
for i in range(5):
if not self.core.get_rtio_destination_status(i):
return False
return True
2018-06-22 18:57:49 +08:00
@kernel
def run(self):
while True:
print("waiting for DRTIO ready...")
while not self.drtio_is_up():
2018-06-22 18:57:49 +08:00
pass
print("OK")
self.core.reset()
for sawg in self.sawgs:
delay(1*ms)
sawg.reset()
2018-06-22 18:57:49 +08:00
for sawg in self.sawgs:
delay(1*ms)
sawg.amplitude1.set(.4)
# Do not use a sub-multiple of oscilloscope sample rates.
sawg.frequency0.set(9*MHz)
while self.drtio_is_up():
2018-06-22 18:57:49 +08:00
pass