In [1]:
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)


---------------------------------------------------------------------------
TimeoutError                              Traceback (most recent call last)
d:\projects\qcodes\qcodes\instrument\ip.py in _connect(self)
    105             self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--> 106             self._socket.connect((self._address, self._port))
    107             self.set_timeout(self._timeout)

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-1-0f5be9c92059> in <module>()
     20 qwg1 = QuTech_AWG_Module(
     21     'QWG', address=ip,
---> 22     port=5025)

d:\projects\pycqed_py3\pycqed\instrument_drivers\physical_instruments\QuTech_AWG_Module.py in __init__(self, name, address, port, **kwargs)
     47 
     48     def __init__(self, name, address, port, **kwargs):
---> 49         super().__init__(name, address, port, **kwargs)
     50 
     51         # AWG properties

d:\projects\pycqed_py3\pycqed\instrument_drivers\physical_instruments\SCPI.py in __init__(self, name, address, port, **kwargs)
     25         super().__init__(name, address, port,
     26                          write_confirmation=False,  # required for QWG
---> 27                          **kwargs)
     28 
     29         # send things immediately

d:\projects\qcodes\qcodes\instrument\ip.py in __init__(self, name, address, port, timeout, terminator, persistent, write_confirmation, testing, **kwargs)
     54         self._socket = None
     55 
---> 56         self.set_persistent(persistent)
     57 
     58     def set_address(self, address=None, port=None):

d:\projects\qcodes\qcodes\instrument\ip.py in set_persistent(self, persistent)
     87         self._persistent = persistent
     88         if persistent:
---> 89             self._connect()
     90         else:
     91             self._disconnect()

d:\projects\qcodes\qcodes\instrument\ip.py in _connect(self)
    104         try:
    105             self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--> 106             self._socket.connect((self._address, self._port))
    107             self.set_timeout(self._timeout)
    108         except ConnectionRefusedError:

KeyboardInterrupt: 

In [1]:
qwg1.reset()


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-04fae6cd19c6> in <module>()
----> 1 qwg1.reset()

NameError: name 'qwg1' is not defined

In [3]:
qwg1.stop()

In [4]:
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)

waveformLine = []
for x in range(0, length):
    waveformLine.append(0)

waveformSine = np.sin(np.arange(length)*2*np.pi/(length))
waveformCosine = np.cos(np.arange(length)*2*np.pi/length)

qwg1.createWaveformReal('sin', waveformSine)
qwg1.createWaveformReal('line', np.array(waveformLine)
plt.plot(waveformSine)
plt.plot(waveformLine)


Out[4]:
[<matplotlib.lines.Line2D at 0xa6cf0f0>]

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

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

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

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

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

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

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

In [11]:
qwg1.stop()


---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-11-e993a50a1c79> in <module>()
----> 1 qwg1.stop()

d:\projects\pycqed_py3\pycqed\instrument_drivers\physical_instruments\QuTech_AWG_Module.py in stop(self)
    228         self.write('awgcontrol:stop:immediate')
    229 
--> 230         self.detectOverflow()
    231         self.getErrors()
    232 

d:\projects\pycqed_py3\pycqed\instrument_drivers\physical_instruments\QuTech_AWG_Module.py in detectOverflow(self)
    282                 err_msg.append("Wave overflow detected on channel: {}".format(channel["id"]))
    283         if(errors == True):
--> 284             raise RuntimeError(err_msg)
    285 
    286     # def detectPosibleOverflow(self, status):

RuntimeError: ['Wave overflow detected on channel: 1', 'Wave overflow detected on channel: 2']

In [ ]: