Skip to content

Commit

Permalink
Merge branch 'master' into driver/Keithley2600_buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen authored Sep 19, 2017
2 parents 4b2a494 + 41530ba commit 524941b
Show file tree
Hide file tree
Showing 14 changed files with 111 additions and 61 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ See `License <https://github.com/QCoDeS/Qcodes/tree/master/LICENSE.rst>`__.
:target: https://travis-ci.org/QCoDeS/Qcodes
.. |DOCS| image:: https://img.shields.io/badge/read%20-thedocs-ff66b4.svg
:target: http://qcodes.github.io/Qcodes
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.826079.svg
:target: https://doi.org/10.5281/zenodo.843493
.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.894477.svg
:target: https://doi.org/10.5281/zenodo.894477
28 changes: 28 additions & 0 deletions docs/changes/0.1.7.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Changelog for QCoDeS 0.1.7
==========================

New & Improved
--------------

- New and Improved drivers:

- Fixes to DecaDac driver (#713)
- Driver for Oxford Kelvinox (#707)
- Driver for Oxford ILM 200 Helium Level Meter (#706)
- IPS120 Magnet driver (#660)
- New AMI430 driver (#700)
- Driver for tektronics awg5200 (#724)
- Benchmark Keysight DMM software trigger (#729)
- Faster qdac (#730, #737)
- Ivvi triggers (#739)

- Features:

- Improved PyQtGraph performance (#712)
- Improve default_parameter_name (#714)
- Function to Close all instruments (#715)
- Automatic Foreground qt window (#716) Requires pywin32 on windows not
installed by default
- Handle snapshot update failing better (#717)
- Cleanup dependencies for easier install (#721)
- Update Slack contact information (#727)
1 change: 1 addition & 0 deletions docs/changes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Changelogs
0.1.4 <0.1.4>
0.1.5 <0.1.5>
0.1.6 <0.1.6>
0.1.7 <0.1.7>
17 changes: 14 additions & 3 deletions docs/examples/driver_examples/Qcodes example with AMI430.ipynb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# QCoDeS example with AMI430"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -36,7 +43,9 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import time\n",
Expand Down Expand Up @@ -199,7 +208,9 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Lets test the 3D driver now. \n",
Expand Down Expand Up @@ -446,7 +457,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.5"
"version": "3.6.2"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion qcodes/instrument_drivers/Keysight/Keysight_34465A.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(self, name, address, DIG=False, utility_freq=50, silent=False,
0.01e-6]
}
if DIG:
res_factors['34465A'] = [30e6, 15e-6, 6e-6] + res_factors['34464A']
res_factors['34465A'] = [30e-6, 15e-6, 6e-6] + res_factors['34465A']
res_factors['34470A'] = [30e-6, 10e-6, 3e-6] + res_factors['34470A']

# Define the extreme aperture time values for the 34465A and 34470A
Expand Down
17 changes: 13 additions & 4 deletions qcodes/instrument_drivers/QDev/QDac.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ def __init__(self, name, address, num_chans=48, update_currents=True):
set_cmd='ver {}',
val_mapping={True: 1, False: 0})

self.add_parameter(name='fast_voltage_set',
label='fast voltage set',
parameter_class=ManualParameter,
vals=vals.Bool(),
initial_value=False,
docstring=""""Toggles if DC voltage set should unset any ramp attached to this channel.
If you enable this you should ensure thay any function generator is unset
from the channel before setting voltage""")
# Initialise the instrument, all channels DC (unbind func. generators)
for chan in self.chan_range:
# Note: this call does NOT change the voltage on the channel
Expand Down Expand Up @@ -208,17 +216,18 @@ def _set_voltage(self, chan, v_set):
self._assigned_fgs[chan] = fg
# We need .get and not get_latest in case a ramp was interrupted
v_start = self.parameters['ch{:02}_v'.format(chan)].get()
time = abs(v_set-v_start)/slope
log.info('Slope: {}, time: {}'.format(slope, time))
mytime = abs(v_set-v_start)/slope
log.info('Slope: {}, time: {}'.format(slope, mytime))
# Attenuation compensation and syncing
# happen inside _rampvoltage
self._rampvoltage(chan, fg, v_start, v_set, time)
self._rampvoltage(chan, fg, v_start, v_set, mytime)
else:
# compensate for the 0.1 multiplier, if it's on
if self.parameters['ch{:02}_vrange'.format(chan)].get_latest() == 1:
v_set = v_set*10
# set the mode back to DC in case it had been changed
self.write('wav {} 0 0 0'.format(chan))
if not self.fast_voltage_set():
self.write('wav {} 0 0 0'.format(chan))
self.write('set {} {:.6f}'.format(chan, v_set))

def _set_vrange(self, chan, switchint):
Expand Down
22 changes: 15 additions & 7 deletions qcodes/instrument_drivers/QDev/QDac_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@ def __init__(self, name, address, num_chans=48, update_currents=True):
set_cmd='ver {}',
val_mapping={True: 1, False: 0})

self.add_parameter(name='fast_voltage_set',
label='fast voltage set',
parameter_class=ManualParameter,
vals=vals.Bool(),
initial_value=False,
docstring=""""Deprecated with no functionality""")
# Initialise the instrument, all channels DC (unbind func. generators)
for chan in self.chan_range:
# Note: this call does NOT change the voltage on the channel
Expand Down Expand Up @@ -314,8 +320,8 @@ def _set_voltage(self, chan, v_set):
if self.channels[chan-1].vrange.get_latest() == 1:
v_set = v_set*10
# set the mode back to DC in case it had been changed
self.write('wav {} 0 0 0'.format(chan))
self.write('set {} {:.6f}'.format(chan, v_set))
# and then set the voltage
self.write('wav {} 0 0 0;set {} {:.6f}'.format(chan, chan, v_set))

def _set_vrange(self, chan, switchint):
"""
Expand Down Expand Up @@ -633,18 +639,20 @@ def write(self, cmd):
if you want to use this response, we put it in self._write_response
(but only for the very last write call)
Note that this procedure makes it cumbersome to handle the returned
messages from concatenated commands, e.g. 'wav 1 1 1 0;fun 2 1 100 1 1'
Please don't use concatenated commands
In this method we expect to read one termination char per command. As
commands are concatenated by `;` we count the number of concatenated
commands as count(';') + 1 e.g. 'wav 1 1 1 0;fun 2 1 100 1 1' is two
commands. Note that only the response of the last command will be
available in `_write_response`
TODO (WilliamHPNielsen): add automatic de-concatenation of commands.
"""
if self.debugmode:
log.info('Sending command string: {}'.format(cmd))

nr_bytes_written, ret_code = self.visa_handle.write(cmd)
self.check_error(ret_code)
self._write_response = self.visa_handle.read()
for _ in range(cmd.count(';')+1):
self._write_response = self.visa_handle.read()

def read(self):
return self.visa_handle.read()
Expand Down
10 changes: 10 additions & 0 deletions qcodes/instrument_drivers/QuTech/IVVI.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ def __init__(self, name, address, reset=False, numdacs=16, dac_step=10,
label='Dac voltages',
get_cmd=self._get_dacs)

self.add_function(
'trigger',
call_cmd=self._send_trigger
)

# initialize pol_num, the voltage offset due to the polarity
self.pol_num = np.zeros(self._numdacs)
for i in range(int(self._numdacs / 4)):
Expand Down Expand Up @@ -468,6 +473,11 @@ def get_func():
return fun(ch)
return get_func

def _send_trigger(self):
msg = bytes([2, 6])
self.write(msg)
self.read() # Flush the buffer, else the command will only work the first time.

def round_dac(self, value, dacname=None):
""" Round a value to the interal precision of the instrument
Expand Down
55 changes: 16 additions & 39 deletions qcodes/instrument_drivers/oxford/ILM200.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@ def __init__(self, name, address, number=1, **kwargs):
"""
Initializes the Oxford Instruments ILM 200 Helium Level Meter.
Input:
name (string) : name of the instrument
address (string) : instrument address
number (int) : ISOBUS instrument number
(number=1 is specific to the ILM in F008)
Args:
name (string): name of the instrument
address (string): instrument address
number (int): ISOBUS instrument number (number=1 is specific to the ILM in F008)
Output:
Returns:
None
"""
logging.debug(__name__ + ' : Initializing instrument')
Expand Down Expand Up @@ -73,10 +72,10 @@ def _execute(self, message):
Write a command to the device and read answer. This function writes to
the buffer by adding the device number at the front, instead of 'ask'.
Input:
Args:
message (str) : write command for the device
Output:
Returns:
None
"""
logging.info(
Expand All @@ -93,10 +92,10 @@ def _read(self):
"""
Reads the total bytes in the buffer and outputs as a string.
Input:
Args:
None
Output:
Returns:
message (str)
"""
# because protocol has no termination chars the read reads the number
Expand All @@ -112,7 +111,7 @@ def _read(self):

def get_idn(self):
"""
Overides the function of Instrument since ILM does not support '*IDN?'
Overrides the function of Instrument since ILM does not support `*IDN?`
This string is supposed to be a
comma-separated list of vendor, model, serial, and firmware, but
Expand Down Expand Up @@ -143,12 +142,6 @@ def get_all(self):
"""
Reads all implemented parameters from the instrument,
and updates the wrapper.
Args:
None
Returns:
None
"""
logging.info(__name__ + ' : reading all settings from instrument')
self.level.get()
Expand All @@ -171,7 +164,7 @@ def _get_version(self):
Args:
None
Return:
Returns:
identification (str): should be 'ILM200 Version 1.08 (c) OXFORD 1994\r'
"""
logging.info(__name__ + ' : Identify the device')
Expand All @@ -180,7 +173,8 @@ def _get_version(self):
def _do_get_level(self):
"""
Get Helium level of channel 1.
Input:
Args:
None
Returns:
Expand All @@ -193,11 +187,6 @@ def _do_get_level(self):
def _do_get_status(self):
"""
Get status of the device.
Input:
None
Returns:
None
"""
logging.info(__name__ + ' : Get status of the device.')
result = self._execute('X')
Expand Down Expand Up @@ -242,25 +231,13 @@ def _do_get_rate(self):
def remote(self):
"""
Set control to remote & locked
Input:
None
Output:
None
"""
logging.info(__name__ + ' : Set control to remote & locked')
self.set_remote_status(1)

def local(self):
"""
Set control to local & locked
Input:
None
Output:
None
"""
logging.info(__name__ + ' : Set control to local & locked')
self.set_remote_status(0)
Expand All @@ -269,14 +246,14 @@ def set_remote_status(self, mode):
"""
Set remote control status.
Input:
Args:
mode(int) :
0 : "Local and locked",
1 : "Remote and locked",
2 : "Local and unlocked",
3 : "Remote and unlocked",
Output:
Returns:
None
"""
status = {
Expand Down Expand Up @@ -312,7 +289,7 @@ def _do_set_rate(self, rate):
"""
Set helium meter channel 1 probe rate
Input:
Args:
rate(int) :
0 : "SLOW"
1 : "FAST"
Expand Down
2 changes: 1 addition & 1 deletion qcodes/instrument_drivers/oxford/IPS120.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def close(self):

def get_idn(self):
"""
Overides the function of Instrument since IPS120 does not support '*IDN?'
Overides the function of Instrument since IPS120 does not support `*IDN?`
This string is supposed to be a comma-separated list of vendor, model,
serial, and firmware, but semicolon and colon are also common
Expand Down
4 changes: 3 additions & 1 deletion qcodes/instrument_drivers/oxford/kelvinox.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def _read(self):
def identify(self):
"""Identify the device
Returns a string of the form `'IGH Version 3.02 (c) OXFORD 1998\r'`
Returns:
a string of the form ``'IGH Version 3.02 (c) OXFORD 1998\\r'``
"""
log.info('Identify the device')
return self._execute('V')
Expand Down
3 changes: 3 additions & 0 deletions qcodes/instrument_drivers/rohde_schwarz/ZNB20.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ensuring backwards compatibility

from .ZNB import ZNB as ZNB20
5 changes: 3 additions & 2 deletions qcodes/instrument_drivers/stanford_research/SR830.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ChannelBuffer(ArrayParameter):
Currently always returns the entire buffer
TODO (WilliamHPNielsen): Make it possible to query parts of the buffer.
The instrument natively supports this in its TRCL call.
The instrument natively supports this in its TRCL call.
"""

def __init__(self, name: str, instrument: 'SR830', channel: int):
Expand Down Expand Up @@ -108,7 +108,8 @@ def get(self):
# parse it
realdata = np.fromstring(rawdata, dtype='<i2')
numbers = realdata[::2]*2.0**(realdata[1::2]-124)

if self.shape[0] != N:
raise RuntimeError("SR830 got {} points in buffer expected {}".format(N, self.shape[0]))
return numbers


Expand Down
Loading

0 comments on commit 524941b

Please sign in to comment.