Skip to content
urukul_testall.py 1.52 KiB
Newer Older
from pyLIAF.artiq.controllers import UrukulCh
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's avatar
Nicolas Nunez Barreto committed
        RF_ch3 = UrukulCh(self, ch=3, freq=80.0, amp=0.37)

        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()
        delay(1000*ms)
        # initialises CPLD all the selected channels
        for rf_ch in self.RF_chs:
            rf_ch.initialize_channel()
            self.core.break_realtime()
        delay(100*ms)
            self.core.break_realtime()

        for rf_ch in self.RF_chs:
            rf_ch.channel.set_att(0.)
            self.core.break_realtime()
#        self.core.break_realtime()