QDAC-II sine wavesΒΆ
[1]:
from time import sleep
from IPython.display import Image, display
from qcodes_contrib_drivers.drivers.QDevil import QDAC2
qdac_addr = '192.168.8.17'
qdac = QDAC2.QDac2('QDAC', visalib='@py', address=f'TCPIP::{qdac_addr}::5025::SOCKET')
from qcodes.instrument_drivers.rigol import RigolDS1074Z
rigol_addr = '192.168.8.199'
scope = RigolDS1074Z('rigol', visalib='@py', address=f'TCPIP::{rigol_addr}::INSTR')
Connected to: QDevil QDAC-II (serial:3, firmware:10-1.4) in 0.21s
Connected to: RIGOL TECHNOLOGIES DS1104Z (serial:DS1ZA171812151, firmware:00.04.03) in 0.01s
[2]:
def capture():
scope.write('stop')
scope.write(":disp:data?")
bmpdata = scope.visa_handle.read_raw()[2+9:]
image = Image(data=bmpdata)
display(image)
[3]:
scope.write('*rst')
qdac.reset()
[4]:
# Connect scope ch 3 to qdac ch 3
scope.write('chan1:disp off')
scope.write('chan3:disp on')
scope.write('chan3:bwl on')
scope.write('chan3:prob 1')
scope.write('chan3:scal 0.05')
scope.write('chan3:offs 0.0')
scope.write('trig:edge:sour chan3')
scope.write('trig:edge:level 0.08')
scope.write('tim:scal 1e-3')
scope.write('tim:offs 0')
[5]:
sine = qdac.ch03.sine_wave()
[6]:
scope.write('run')
sine.start()
[8]:
capture()
[7]:
scope.write('chan1:disp off')
scope.write('chan3:disp on')
scope.write('chan3:bwl on')
scope.write('chan3:prob 1')
scope.write('chan3:scal 0.5')
scope.write('chan3:offs 0.0')
scope.write('trig:edge:sour chan3')
scope.write('trig:edge:level 0.2')
scope.write('tim:scal 100e-6')
scope.write('tim:offs 0')
[8]:
sine = qdac.ch03.sine_wave(
period_s=200e-6,
span_V=1,
offset_V=0.5
)
[9]:
scope.write('run')
sine.start()
[12]:
capture()
[10]:
sine = qdac.ch03.sine_wave(
period_s=200e-6,
span_V=1,
repetitions=4,
slew_V_s=20000
)
sleep(3)
qdac.errors()
[10]:
'0, "No error"'
[11]:
scope.write('tim:offs 400e-6')
scope.write('sing')
sleep(3)
sine.start()
[15]:
sleep(1)
capture()
[12]:
# Connect scope ch 4 to qdac output trigger 4
trigger = sine.period_end_marker()
qdac.ext4.width_s(2e-5)
qdac.ext4.source_from_trigger(trigger)
scope.write('chan4:disp on')
scope.write('chan4:bwl on')
scope.write('chan4:prob 1')
scope.write('chan4:scal 1')
scope.write('chan4:offs -2')
qdac.errors()
[12]:
'0, "No error"'
[13]:
scope.write('sing')
sleep(3)
sine.start()
[18]:
sleep(1)
capture()