Hi,
I cannot get my Almazny v1.1 to output anything. Here's some example code:
from artiq.experiment import* #imports everything from the artiq experiment library
class Almazny_Frequency_TEST(EnvExperiment):
"""TEST Almazny Single Frequency"""
def build(self):
self.setattr_device("core")
self.setattr_device("mirny0_ch1")
self.setattr_device("mirny0_almazny")
self.setattr_argument("Frequency", NumberValue(99, ndecimals=3, step=.001), group = "Almazny TEST", tooltip = "[MHz] | Frequency output on Almazny0 CH0")
self.setattr_argument("Attenuation", NumberValue(1, ndecimals=3, step=.001), group = "Almazny TEST", tooltip = "[dB] | Attenuation on Almazny0 CH0")
# self.setattr_argument("Amplitude", NumberValue(1, ndecimals=3, step=.001), group = "Almazny TEST", tooltip = "[of full scale] | Amplitude on Almazny0 CH0")
self.setattr_argument("Turn_on_length", NumberValue(1, ndecimals=3, step=.001), group = "Almazny TEST", tooltip = "[s] | Turn on Almazny0 CH0 for this long for testing")
@kernel
def run(self):
self.core.reset() #resets core device
#self.mirny0_ch0.Mirny.init() #initialises CPLD on channel 1
self.mirny0_ch1.cpld.init()
self.mirny0_ch1.init() #initialises channel 1
delay(10 * ms) #10ms delay
freq = self.Frequency*MHz #defines frequency variable
# amp = self.Amplitude #defines amplitude variable as an amplitude scale factor(0 to 1)
attenuation= self.Attenuation #defines attenuation variable
self.mirny0_ch1.set_att(attenuation) #writes attenuation to Mirny channel
self.mirny0_ch1.sw.on() #switches Mirny channel on
self.core.break_realtime()
self.mirny0_ch1.set_frequency(freq) #writes frequency and amplitude variables to Mirny channel thus outputting function
self.core.break_realtime()
self.mirny0_almazny.output_toggle(True)
self.mirny0_almazny.att_to_mu(0)
self.mirny0_almazny.set_att(0, 0, True)
delay(self.Turn_on_length*s) #x s delay
self.mirny0_ch1.sw.off()
The Mirny output works. But the Almazny is just not outputting anything. I'm looking at the output on a spectrum analyzer.
I've tried a bunch of small variations of the code trying to get it to work, but no luck.
Please help correcting any problems with the code or suggest other things I can try to debug this.
Thanks,
Malte