QDAC-II trigger chainingΒΆ
[1]:
from time import sleep
import numpy
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.23s
Connected to: RIGOL TECHNOLOGIES DS1104Z (serial:DS1ZA171812151, firmware:00.04.03) in 0.12s
[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]:
scope.write('chan1:disp off')
# Connect scope ch 3 to qdac ch 3
scope.write('chan3:disp on')
scope.write('chan3:bwl on')
scope.write('chan3:prob 1')
scope.write('chan3:scal 0.25')
scope.write('chan3:offs -0.5')
# Connect scope ch 2 to qdac ch 2
scope.write('chan2:disp on')
scope.write('chan2:bwl on')
scope.write('chan2:prob 1')
scope.write('chan2:scal 0.25')
scope.write('chan2:offs -0.5')
scope.write('trig:edge:sour chan2')
scope.write('trig:edge:level 0.25')
scope.write('tim:scal 20e-6')
scope.write('tim:offs 20e-6')
[5]:
dc_list_3 = qdac.ch03.dc_list(
voltages=numpy.linspace(0, 1, 11),
dwell_s=10e-6
)
dc_list_2 = qdac.ch02.dc_list(
voltages=numpy.linspace(1, 0, 11),
dwell_s=10e-6
)
qdac.errors()
[5]:
'0, "No error"'
[6]:
scope.write('sing')
sleep(3)
qdac.start_all()
qdac.errors()
[6]:
'0, "No error"'
[7]:
capture()
[7]:
list2_end = dc_list_2.end_marker()
dc_list_3.start_on(list2_end)
qdac.errors()
[7]:
'0, "No error"'
[8]:
scope.write('tim:offs 100e-6')
scope.write('sing')
sleep(3)
qdac.start_all()
qdac.errors()
[8]:
'0, "No error"'
[10]:
capture()
[9]:
qdac.reset()
[10]:
scope.write('tim:scal 2e-4')
scope.write('tim:offs 10e-4')
square = qdac.ch03.square_wave(frequency_Hz=1e4)
dc_list_2 = qdac.ch02.dc_list(
voltages=numpy.linspace(1, 0, 11),
dwell_s=1e-4
)
list2_end = dc_list_2.end_marker()
square.start_on(list2_end)
qdac.errors()
[10]:
'0, "No error"'
[11]:
scope.write('sing')
sleep(3)
qdac.start_all()
qdac.errors()
[11]:
'0, "No error"'
[14]:
capture()