QDAC-II voltage listsΒΆ

[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.02s
[2]:
scope.write('*rst')
qdac.reset()
[3]:
def capture():
    scope.write('stop')
    scope.write(":disp:data?")
    bmpdata = scope.visa_handle.read_raw()[2+9:]
    image = Image(data=bmpdata)
    display(image)
[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.2')
scope.write('chan3:offs 0.0')
scope.write('trig:edge:sour chan3')
scope.write('trig:edge:level 0.25')
scope.write('tim:scal 5e-6')
scope.write('tim:offs 4e-6')
[5]:
dc_list = qdac.ch03.dc_list(
    repetitions=2,
    voltages=[-0.1, 0.1, -0.2, 0.2, -0.4, 0.4],
    dwell_s=2e-6
)
dc_list.points()
[5]:
6
[6]:
scope.write('sing')
sleep(3)
dc_list.start()
qdac.errors()
[6]:
'0, "No error"'
[7]:
capture()
../../../_images/examples_QDevil_QDAC2_List_7_0.png
[7]:
dc_list.append((-0.8, 0.8, 0))
dc_list.points()
[7]:
9
[8]:
scope.write('sing')
sleep(3)
dc_list.start()
[10]:
capture()
../../../_images/examples_QDevil_QDAC2_List_10_0.png
[9]:
dc_list = qdac.ch03.dc_list(
    repetitions=-1,
    voltages=[-0.1, 0.1, -0.2, 0.2, -0.4, 0.4],
    dwell_s=2e-6
)
[10]:
scope.write('chan3:scal 0.1')
scope.write('run')
dc_list.start()
[13]:
capture()
../../../_images/examples_QDevil_QDAC2_List_13_0.png
[15]:
trigger = dc_list.step_start_marker()
qdac.ext4.width_s(1e-6)
qdac.ext4.polarity('norm')
qdac.ext4.source_from_trigger(trigger)
# Connect osc ch 4 to qdac out trigger 4
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')
scope.write('tim:scal 2e-6')
qdac.errors()
[15]:
'0, "No error"'
[16]:
scope.write('run')
dc_list.start()
[16]:
capture()
../../../_images/examples_QDevil_QDAC2_List_16_0.png
[17]:
trigger = dc_list.step_end_marker()
qdac.ext1.width_s(1e-6)
qdac.ext1.polarity('norm')
qdac.ext1.source_from_trigger(trigger)
# Connect osc ch 1 to qdac out trigger 1
scope.write('chan1:disp on')
scope.write('chan1:bwl on')
scope.write('chan1:prob 1')
scope.write('chan1:scal 1')
scope.write('chan1:offs -2')
qdac.errors()
[17]:
'0, "No error"'
[18]:
scope.write('run')
dc_list.start()
[21]:
capture()
../../../_images/examples_QDevil_QDAC2_List_19_0.png
[19]:
scope.write('run')
sleep(1)
dc_list.abort()
[20]:
with qdac.ch03.dc_list(
    repetitions=2,
    voltages=[-0.1, 0.1, -0.2, 0.2, -0.4, 0.4],
    dwell_s=2e-6
) as my_list:
    print(my_list.points())
6