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

Add trigger, and program feature to Yokogawa GS200, and digitizer feature to Keithley 7510 #2138

Merged

Conversation

liangosc
Copy link
Contributor

@liangosc liangosc commented Sep 3, 2020

First of all, this PR includes changes to two instruments.

The reason why I want to include two changes in one:
The changes made to the Yokogawa GS200 will add the ability of programming source data pattern, and sending out external triggers. Hence, it'll be great if I can measure the pattern with a dmm which can receive the trigger.

The changes made to the Keithley 7510 will add the ability of receiving external trigger, and performing a "digitize" measurement, which is ideal for high speed measurement.

It feels "incomplete" if I include the new changes to each instrument in its existing QCoDeS example, so I combine two together in this one PR, with one new example notebook, but I can always split this PR into two separate ones if necessary.

Changes proposed in this pull request:

For the Yokogawa GS200:

  • A "GS200_Program" class is added, so that the user can program the source data pattern. Each step in the program is executed in order, and each step has a fixed execution time. User can also set the slope time, and generate step responses, ramp responses, and various waveforms such as triangular waveforms.
  • BNC trigger in and out are added as parameters.

For the Keithley 7510:

  • The "Buffer" class is added, same as the one for Keithley 2450, and several related parameter/methods are also added to the driver.
  • A new "DigitizeSense" class is added. The digitize sense function is similar to the normal sense, but has some of its own method. In other words, the "digitize sense" and "sense" each has some unique methods, so I decided to make a new class, instead of subclass the "Sense" class.

@sohailc

@codecov
Copy link

codecov bot commented Sep 3, 2020

Codecov Report

Merging #2138 into master will decrease coverage by 0.13%.
The diff coverage is 55.23%.

@@            Coverage Diff             @@
##           master    #2138      +/-   ##
==========================================
- Coverage   71.74%   71.60%   -0.14%     
==========================================
  Files         156      156              
  Lines       20749    20919     +170     
==========================================
+ Hits        14886    14979      +93     
- Misses       5863     5940      +77     

@jenshnielsen
Copy link
Collaborator

There does not seem to be an example of reading the buffer into a qcodes parameter. Is this supported? It is an esential feature for a qcodes driver to be able to capture the data as a parameter so it can be storred in a dataset easily

Copy link
Contributor Author

@liangosc liangosc left a comment

Choose a reason for hiding this comment

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

There does not seem to be an example of reading the buffer into a qcodes parameter. Is this supported? It is an esential feature for a qcodes driver to be able to capture the data as a parameter so it can be storred in a dataset easily

I have made data a parameter, and the usage is as following:

buffer.data_start = 1
buffer.data_end = total_data_points
v=buffer.data()

the type of v is a list, with float-type elements.

User can specify several different elements, such as time, measurement, unit...

buffer.elements(['measurement', 'time', 'measurement_unit'])
data=buffer.data()

In this case, the data will be a 3xN matrix/array, of which all the elements are str-type.

I didn't add the vals=Arrays(...) nor the parameter_class, for the data parameter, because:

  1. the shape of the data is not fixed, it depends on how many elements the user wants;
  2. the parameter_class=... part can only be added if there is the vals=Arrays(..)
    suggestion? @jenshnielsen

(Maybe I can just save everything -- all total 14 elements)

qcodes/instrument_drivers/yokogawa/GS200.py Show resolved Hide resolved
qcodes/instrument_drivers/yokogawa/GS200.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/yokogawa/GS200.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/tektronix/keithley_7510.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/tektronix/keithley_7510.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/tektronix/keithley_7510.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/tektronix/keithley_7510.py Outdated Show resolved Hide resolved
qcodes/instrument_drivers/tektronix/keithley_7510.py Outdated Show resolved Hide resolved
style: str = ''
) -> None:
super().__init__(parent, name)
self.buffer_name = name
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is self.buffer_name needed. It seems like this will always be equivalent to self.short_name which is already defined on all instruments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out self.short_name works. (not self.name though)

I was not sure if I should use self.name or self.short_name, so I created my own... :D

@jenshnielsen
Copy link
Collaborator

jenshnielsen commented Sep 16, 2020

(Maybe I can just save everything -- all total 14 elements)

I think you can set this up dynamically from the parameters that determine the size. Have a look at
https://qcodes.github.io/Qcodes/examples/Parameters/Simple-Example-of-ParameterWithSetpoints.html?highlight=parameterwithsetpoints and see if it is possible to do something similar to the parameter with setpoints

EDIT:

It would be nice to have it as a ParameterWithSetpoints so that one can register what setpoints the axes corresponds to

@liangosc
Copy link
Contributor Author

liangosc commented Sep 23, 2020

(Maybe I can just save everything -- all total 14 elements)

I think you can set this up dynamically from the parameters that determine the size. Have a look at
https://qcodes.github.io/Qcodes/examples/Parameters/Simple-Example-of-ParameterWithSetpoints.html?highlight=parameterwithsetpoints and see if it is possible to do something similar to the parameter with setpoints

EDIT:

It would be nice to have it as a ParameterWithSetpoints so that one can register what setpoints the axes corresponds to

I tried to match what they did in the example, and here it is...

My concerns:

  1. a dummy_setpoints variable is used -- is it necessary?
  2. I have to remove the datatype validation because the result may not be Array (it can be list of string values)

All those extra works just to make the data a parameter. Suggestion? @jenshnielsen

"cell_type": "markdown",
"metadata": {},
"source": [
"## 4. Make the measurement"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rewrite this section so that we only show how to make measurements with qcodes. We do not want to promote manual measurements with this driver that are different from every other driver

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The make measurement section has been rewritten.

@jenshnielsen jenshnielsen merged commit 6358f0c into microsoft:master Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants