<jupyter_start><jupyter_text>QCoDeS Example with Agilent 34400A This notebook shows how to work with Agilent 34400A instrument qcodes driver and conduct measurements. Agilent 34400A qcodes driver works well for Agilent/HP 34401A instrument and these of two instruments have been used with Keithley 2600 equipment for testing purposes of this notebook. Image below shows the setup. ![title](../files/agilent34400Asetup.png) Two Agilent 34400A instruments can be connected to a Keithley 2600 equipment simultaneously using a custom made connector. This connector connects to the Keithley 2600 equipment through two channels on the back panel as shown below. ![title1](../files/keithley2600connector.png) In this notebook, we show how to conduct measurements with help of one Agilent/HP 34401A instrument connected with a Keithley 2600 equipment and then with two Agilent/HP 34401A instrument connected to two different channels of Keithley through a custom made connector. In the second scenario, measurment happens simultaneously.Lets begin... Imports<jupyter_code>%matplotlib nbagg
import matplotlib.pyplot as plt
import os
import numpy as np

import qcodes.instrument_drivers.tektronix.Keithley_2600_channels as keith
import qcodes.instrument_drivers.agilent.Agilent_34400A as agi
from qcodes.dataset import load_or_create_experiment, Measurement
from qcodes.dataset.plotting import plot_dataset<jupyter_output><empty_output><jupyter_text>Initialize instruments<jupyter_code>k1 = keith.Keithley_2600('Keithley1', address='GPIfc00:db20:35b:7399::5::INSTR')
a1 = agi.Agilent_34400A('Agilent2', 'GPIfd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b::INSTR')
a2 = agi.Agilent_34400A('Agilent1', 'GPIfc00:e968:6179::de52:7100::INSTR')


# set integration time (number of line cycles)
a1.NPLC.set(10)
a2.NPLC.set(10)<jupyter_output>Connected to: Keithley Instruments Inc. 2614B (serial:4305420, firmware:3.2.2) in 0.32s
Connected to: HEWLETT-PACKARD 34401A (serial:0, firmware:11-5-2) in 0.12s
Connected to: HEWLETT-PACKARD 34401A (serial:0, firmware:10-5-2) in 0.08s<jupyter_text>Station creation with initialized instruments Above initialized instruments can be registered as components to your station by following instructions as mentioned in [15 min of QCoDeS Notebook](../15_minutes_to_QCoDeS.ipynb)  Load an experiment or create a new one<jupyter_code>tutorial_exp = load_or_create_experiment('tutorial_experiment', sample_name= 'no_sample')<jupyter_output><empty_output><jupyter_text>Measurements Here, we use our Keithley k1 as the voltage source, and our Agilent a1 for measuring the voltage generated by k1. So, here we expect our generated data to be the same as measured ones, which we will plot shortly.<jupyter_code>meas1 = Measurement(exp=tutorial_exp)
meas1.register_parameter(k1.smua.volt)
meas1.register_parameter(a1.volt, setpoints=[k1.smua.volt])

with meas1.run() as datasaver:
    for set_v in np.linspace(-5, 5, 21):
        k1.smua.volt.set(set_v)
        datasaver.add_result((k1.smua.volt,k1.smua.volt()), (a1.volt, a1.volt()))
dataset = datasaver.dataset
axes, cbax = plot_dataset(dataset)

for i in range(1):
    axes[i].lines[0].set_marker('o')
    axes[i].lines[0].set_markerfacecolor((0.6, 0.6, 0.9))
    axes[i].lines[0].set_markeredgecolor((0.4, 0.6, 0.9))
    axes[i].lines[0].set_color((0.8, 0.8, 0.8))<jupyter_output><empty_output><jupyter_text>We repeat above using two Agilent DMMs to measure voltage generated from both Keithley channels simultaneously:<jupyter_code>meas2 = Measurement(exp=tutorial_exp)
meas2.register_parameter(k1.smua.volt)
meas2.register_parameter(k1.smub.volt)
meas2.register_parameter(a1.volt, setpoints=[k1.smua.volt])
meas2.register_parameter(a2.volt, setpoints=[k1.smub.volt])
with meas2.run() as datasaver:
    for set_v in np.linspace(-5, 5, 21):
        k1.smua.volt(set_v)
        k1.smub.volt(set_v)
        datasaver.add_result(
            (k1.smua.volt, k1.smua.volt()),
            (k1.smub.volt, k1.smub.volt()),
            (a1.volt, a1.volt()),
            (a2.volt, a2.volt()))
dataset2 = datasaver.dataset
axes, cbax = plot_dataset(dataset2)

for i in range(2):
    axes[i].lines[0].set_marker('o')
    axes[i].lines[0].set_markerfacecolor((0.6, 0.6, 0.9))
    axes[i].lines[0].set_markeredgecolor((0.4, 0.6, 0.9))
    axes[i].lines[0].set_color((0.8, 0.8, 0.8))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10947899931145283, 'fraction_numerical': 0.06449391783337159, 'mean_word_length': 5.390029325513196, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '653439', 'license': 'MIT', 'n_tokens_mistral': 1710, 'n_tokens_neox': 1523, 'n_words': 388, 'path': 'docs/examples/driver_examples/Qcodes example with Agilent 34400A.ipynb', 'repo_name': 'jakeogh/Qcodes', 'size': '4288'}