From 5d96f544bc8b1c920e52e461bcb9ad65c72677b5 Mon Sep 17 00:00:00 2001 From: Overlord360 <49475695+Overlord360@users.noreply.github.com> Date: Fri, 6 Dec 2024 11:31:36 +1100 Subject: [PATCH] remove ability to set NPCL for diode measurements from keithley (for compatibility between DMMs) --- src/fixate/drivers/dmm/keithley_6500.py | 3 ++- test/drivers/test_fluke_8846A.py | 9 +++++++++ test/drivers/test_keithley_6500.py | 12 +++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/fixate/drivers/dmm/keithley_6500.py b/src/fixate/drivers/dmm/keithley_6500.py index 5d0acd9..9fe3813 100644 --- a/src/fixate/drivers/dmm/keithley_6500.py +++ b/src/fixate/drivers/dmm/keithley_6500.py @@ -40,14 +40,15 @@ def __init__(self, instrument, *args, **kwargs): "continuity": "CONT", "diode": "DIOD", } + # note: the keithley 6500 also supports changing NPLC for diode measurements, but this has been removed as the fluke does not support it. self._nplc_modes = [ "voltage_dc", "current_dc", "resistance", "fresistance", - "diode", "temperature", ] + # note: the keithley supports setting NPLC to any value between 0.0005 and 12 (with 50hz mains power) but for compatibility with the fluke, we only support the following values self._nplc_settings = [0.02, 0.2, 1, 10] self._nplc_default = 1 self._init_string = "" # Unchanging diff --git a/test/drivers/test_fluke_8846A.py b/test/drivers/test_fluke_8846A.py index da8b748..98da3f7 100644 --- a/test/drivers/test_fluke_8846A.py +++ b/test/drivers/test_fluke_8846A.py @@ -323,6 +323,9 @@ def test_measurement_diode(funcgen, dmm, rm): ("current_dc"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ), @@ -358,6 +361,9 @@ def test_get_nplc(mode, dmm): ("current_dc"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ), @@ -401,6 +407,9 @@ def test_set_nplc(mode, dmm): ("current_dc"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ), diff --git a/test/drivers/test_keithley_6500.py b/test/drivers/test_keithley_6500.py index 1976147..0481b2e 100644 --- a/test/drivers/test_keithley_6500.py +++ b/test/drivers/test_keithley_6500.py @@ -329,9 +329,11 @@ def test_measurement_diode(funcgen, dmm, rm): [ ("voltage_dc"), ("current_dc"), - ("diode"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ), @@ -365,9 +367,11 @@ def test_get_nplc(mode, dmm): [ ("voltage_dc"), ("current_dc"), - ("diode"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ), @@ -409,9 +413,11 @@ def test_set_nplc(mode, dmm): [ ("voltage_dc"), ("current_dc"), - ("diode"), ("resistance"), ("fresistance"), + pytest.param( + "diode", marks=pytest.mark.xfail(raises=ParameterError, strict=True) + ), pytest.param( "voltage_ac", marks=pytest.mark.xfail(raises=ParameterError, strict=True) ),