In [ ]:
from pycqed.instrument_drivers.physical_instruments.QuTech_AWG_Module \
    import QuTech_AWG_Module
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
%matplotlib inline

#qwgDevice = "QWG1"
qwgDevice = "QWG2"

ip = None;

if qwgDevice == "QWG1":
    ip = "192.168.0.10"
elif qwgDevice == "QWG2":
    ip = "192.168.0.11"
else:
    raise RuntimeError('Did not select support device')
    exit()

qwg1 = QuTech_AWG_Module(
    'QWG', address=ip,
    port=5025)

In [ ]:
qwg1.reset()

In [ ]:
qwg1.stop()

In [ ]:
fs = 1e9

# For continuous mode this value should be a multiple of 4e-9
time = 52e-9

length = int(time*fs)
halflength = int(time*fs/2)

waveformSine = np.sin(np.arange(length)*2*np.pi/length)
waveformCosine = np.cos(np.arange(length)*2*np.pi/length)
waveformStep = np.concatenate((np.ones(halflength), -1*np.ones(halflength)), axis=0)
waveformGaus = signal.gaussian(length, std=14)

qwg1.createWaveformReal('sin', waveformSine)
qwg1.createWaveformReal('cos', waveformCosine)
qwg1.createWaveformReal('step', waveformStep)
plt.plot(waveformSine)
plt.plot(waveformCosine)
plt.plot(waveformStep)

In [ ]:
# Set for continuous
qwg1.set('ch1_default_waveform', 'sin')
qwg1.set('ch2_default_waveform', 'sin')
qwg1.set('ch3_default_waveform', 'step')
qwg1.set('ch4_default_waveform', 'sin')

In [ ]:
qwg1.ch_pair1_transform_matrix(np.array([[1, 0],[0, 1]]))
qwg1.ch_pair3_transform_matrix(np.array([[1, 0],[0, 1]]))

In [ ]:
qwg1.ch_pair1_sideband_frequency.set(0)
qwg1.ch_pair3_sideband_frequency.set(0)

In [ ]:
qwg1.ch1_offset(0)
qwg1.ch2_offset(0)
qwg1.ch3_offset(0)
qwg1.ch4_offset(0)

In [ ]:
qwg1.ch1_amp(1.6)
qwg1.ch2_amp(1.6)
qwg1.ch3_amp(1)
qwg1.ch4_amp(1)

In [ ]:
qwg1.ch1_state(True)
qwg1.ch2_state(True)
qwg1.ch3_state(True)
qwg1.ch4_state(True)

qwg1.run_mode('CONt')
qwg1.start()

In [ ]: