Newer
Older
Nicolas Nunez Barreto
committed
from artiq.experiment import *
from pyLIAF.artiq.controllers import UrukulCh
Nicolas Nunez Barreto
committed
import numpy as np
class ControlAllRF(EnvExperiment):
"""Urukul control all RF withe the driver
Set the frecuencies/amplitudes of every Urukul channel
"""
def build(self):
self.setattr_device("core")
# global attenuation
self.setattr_argument("attenuation",
NumberValue(0*dB, unit='dB', scale=dB, min=0*dB, max=31*dB),
)
RF_ch0 = UrukulCh(self, ch=0, freq=100.0, amp=1)
RF_ch1 = UrukulCh(self, ch=1, freq=208.0, amp=0.35)
RF_ch2 = UrukulCh(self, ch=2, freq=110.0, amp=0.3)
Nicolas Nunez Barreto
committed
self.RF_chs = [RF_ch0, RF_ch1, RF_ch2, RF_ch3]
#self.set_dataset("Potencias", np.full(0., 10))
#@rpc
#def get_measurement(self, i):
# val = self.RP.give_measurement()
# self.mutate_dataset("Potencias", i, val)
@kernel
def run(self):
self.core.reset()
Nicolas Nunez Barreto
committed
# initialises CPLD all the selected channels
for rf_ch in self.RF_chs:
rf_ch.initialize_channel()
Nicolas Nunez Barreto
committed
Nicolas Nunez Barreto
committed
for rf_ch in self.RF_chs:
rf_ch.set_channel()
self.core.break_realtime()
for rf_ch in self.RF_chs:
rf_ch.channel.set_att(0.)
self.core.break_realtime()
Nicolas Nunez Barreto
committed
#self.get_measurement(medN)