Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver: Keysight 344xxA - flexible measurements and modularization #1433

Merged

Conversation

astafan8
Copy link
Contributor

@astafan8 astafan8 commented Jan 4, 2019

Improve old Keysight 344xxA DMM (digital multimeter) driver by adding methods and parameters that allow to perform measurement more flexibly than the existing data_buffer ArrayParameter implements. Also, add a new version Keysight 344xxA DMM drivers where parameters are logically grouped in submodules whenever possible.

New driver:

  • uses submodules for traiggering/sampling/display parts
  • does not have data_buffer ArrayParameter
  • tests were ported

Old driver:

  • Deprecate data_buffer ArrayParameter
  • Add many useful missing methods and parameters, like read and fetch

Both drivers:

  • Add example notebook for the drivers with an example of measurement routines
  • Extract error handling to a common mixin class KeysightErrorQueueMixin that is used in 4 Keysight drivers
  • Add many more docstrings
  • Add MIN/MAX/DEF/INF values to parameters that didn't have them
  • Fix a number of cases where a particular model has or doesn't have a particular parameter or a value of a parameter

Replaces and Closes #1393.

(cherry picked from commit 24dc67f)

(that commit has incorrect cast for 'reset' function which is taken
care of here)
it autoranges and then sets autoranging off.
@astafan8 astafan8 changed the title [WIP] Driver: Keysight 344xxA - flexible measurements Driver: Keysight 344xxA - flexible measurements and modularization Jan 7, 2019
@astafan8
Copy link
Contributor Author

astafan8 commented Jan 7, 2019

@QCoDeS/core ready for review

@@ -36,21 +36,6 @@ def setcmd(channel, setting):
def getcmd(channel, setting):
return 'SOURce{}:'.format(channel) + setting + '?'

def errorparser(rawmssg):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not the time to just remove this driver?

Copy link
Contributor Author

@astafan8 astafan8 Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i'll remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't remove it because it requires updating some example notebooks, i'd prefer to do that in a different PR.

@@ -253,21 +256,6 @@ def __init__(self, name, address, silent=False, **kwargs):

super().__init__(name, address, **kwargs)

def errorparser(rawmssg):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Contributor Author

@astafan8 astafan8 Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i'll remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't remove it because it requires updating some example notebooks, i'd prefer to do that in a different PR.

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only made it part way through the review so far, Will get back to it asap

Should these tests be ported https://github.com/QCoDeS/Qcodes/blob/master/qcodes/tests/drivers/test_keysight_34465a.py

def __init__(self, parent: '_Keysight_344xxA', name: str, **kwargs):
super(Trigger, self).__init__(parent, name, **kwargs)

if self.parent.model in ['34465A', '34470A']:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better if all the magic constants were defined in one place. In the root instrument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, definitely!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, tests have been ported.

@astafan8
Copy link
Contributor Author

astafan8 commented Jan 8, 2019

@QCoDeS/core please feel free to continue reviewing :)

@jenshnielsen
Copy link
Collaborator

Dave pointed out that the DIG option is now included by default in the latest fw of at least some of the models (34460A/34461A/34465A/34470A) https://www.keysight.com/main/software.jspx?ckey=2367633&lc=eng&cc=US&nid=-32051.1242959&id=2367633

Should we mention that somewhere in the docs of the new driver?

from qcodes.instrument_drivers.Keysight.private.error_handling import \
KeysightErrorQueueMixin

log = logging.getLogger(__name__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this log ever used. I could not see it used anywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed. will remove.

Copy link
Collaborator

@jenshnielsen jenshnielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the small issues pointed out this looks good. I have tested both the 335xx and 34xxx drivers with the new changes and they seem to work correctly

Create an instance of the instrument.

Args:
name (str): Name used by QCoDeS. Appears in the DataSet
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it on purpose that the types are still here and not as type hints in the signature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely not. i'll clean this up.

@astafan8
Copy link
Contributor Author

astafan8 commented Jan 8, 2019

@jenshnielsen Thanks for testing! I'll finish the minor things and merge after CI is done.

@astafan8 astafan8 merged commit cb51b81 into microsoft:master Jan 8, 2019
@astafan8 astafan8 deleted the driver/34465A/flexible_measurement branch January 8, 2019 17:43
giulioungaretti pushed a commit that referenced this pull request Jan 8, 2019
Merge: ecf286c 24af221
Author: Mikhail Astafev <astafan8@gmail.com>

    Merge pull request #1433 from astafan8/driver/34465A/flexible_measurement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants