-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into driver/ami430_expand
- Loading branch information
Showing
6 changed files
with
125 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Simulated Keysight 34465A instrument | ||
spec: "1.0" | ||
devices: | ||
device 1: | ||
eom: | ||
GPIB INSTR: | ||
q: "\n" | ||
r: "\n" | ||
error: ERROR | ||
dialogues: | ||
- q: "*IDN?" | ||
r: "Keysight, 34465A, 1000, 0.1" | ||
properties: | ||
voltage: | ||
default: 10 | ||
getter: | ||
q: "READ?" | ||
r: "{}" | ||
dc_autorange: | ||
default: 0 | ||
getter: | ||
q: "SENSe:VOLTage:DC:RANGe:AUTO?" | ||
r: "{}" | ||
setter: | ||
q: "SENSe:VOLTage:DC:RANGe:AUTO {}" | ||
r: "{}" | ||
specs: | ||
valid: [0, 1] | ||
type: int | ||
dc_range: | ||
default: 1 | ||
getter: | ||
q: "SENSe:VOLTage:DC:RANGe?" | ||
r: "{}" | ||
setter: | ||
q: "SENSe:VOLTage:DC:RANGe {}" | ||
r: "{}" | ||
specs: | ||
valid: [0.1, 1, 10, 100, 1000] | ||
type: float | ||
NPLC: | ||
default: 10.0 | ||
getter: | ||
q: "SENSe:VOLTage:DC:NPLC?" | ||
r: "{}" | ||
setter: | ||
q: "SENSe:VOLTage:DC:NPLC {}" | ||
r: "{}" | ||
specs: | ||
valid: [0.001, 0.002, 0.006, 0.02, 0.06, .2, 1, 10, 100] | ||
type: float | ||
resolution: | ||
default: +3.00000000E-05 | ||
getter: | ||
q: "SENSe:VOLTage:DC:RESolution?" | ||
r: "{}" | ||
setter: | ||
q: "SENSe:VOLTage:DC:RESolution {}" | ||
r: "{}" | ||
apterture_enabled: | ||
default: 0 | ||
getter: | ||
q: "SENSe:VOLTage:DC:APERture:ENABled?" | ||
r: "{}" | ||
setter: | ||
q: "SENSe:VOLTage:DC:APERture:ENABled {}" | ||
r: "{}" | ||
|
||
|
||
resources: | ||
GPIB::1::INSTR: | ||
device: device 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import pytest | ||
|
||
import qcodes.instrument.sims as sims | ||
from qcodes.instrument_drivers.Keysight.Keysight_34465A import Keysight_34465A | ||
visalib = sims.__file__.replace('__init__.py', 'Keysight_34465A.yaml@sim') | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def driver(): | ||
keysight_sim = Keysight_34465A('keysight_34465A_sim', | ||
address='GPIB::1::65535::INSTR', | ||
visalib=visalib) | ||
|
||
yield keysight_sim | ||
|
||
keysight_sim.close() | ||
|
||
|
||
def test_init(driver): | ||
idn = driver.IDN() | ||
assert idn['vendor'] == 'Keysight' | ||
|
||
|
||
def test_NPLC(driver): | ||
assert driver.NPLC.get() == 10.0 | ||
driver.NPLC.set(0.2) | ||
assert driver.NPLC.get() == 0.2 | ||
|
||
|
||
def test_get_voltage(driver): | ||
voltage = driver.volt.get() | ||
assert voltage == 10.0 | ||
|
||
|
||
def test_set_get_autorange(driver): | ||
ar = driver.autorange.get() | ||
assert ar == 'OFF' | ||
driver.autorange.set('ON') | ||
ar = driver.autorange.get() | ||
assert ar == 'ON' | ||
driver.autorange.set('OFF') | ||
ar = driver.autorange.get() | ||
assert ar == 'OFF' |