| 1 |
# |
| 2 |
# This file is part of the PyMeasure package. |
| 3 |
# |
| 4 |
# Copyright (c) 2013-2024 PyMeasure Developers |
| 5 |
# |
| 6 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
# of this software and associated documentation files (the "Software"), to deal |
| 8 |
# in the Software without restriction, including without limitation the rights |
| 9 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
# copies of the Software, and to permit persons to whom the Software is |
| 11 |
# furnished to do so, subject to the following conditions: |
| 12 |
# |
| 13 |
# The above copyright notice and this permission notice shall be included in |
| 14 |
# all copies or substantial portions of the Software. |
| 15 |
# |
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
# THE SOFTWARE. |
| 23 |
# |
| 24 |
|
| 25 |
from pymeasure.instruments import Instrument |
| 26 |
from pymeasure.instruments.validators import strict_range |
| 27 |
from .ah2500a import AH2500A |
| 28 |
|
| 29 |
|
| 30 |
class AH2700A(AH2500A): |
| 31 |
""" Andeen Hagerling 2700A Precision Capacitance Bridge implementation |
| 32 |
""" |
| 33 |
def __init__(self, adapter, name="Andeen Hagerling 2700A Precision Capacitance Bridge", |
| 34 |
timeout=5000, **kwargs): |
| 35 |
super().__init__( |
| 36 |
adapter, |
| 37 |
name=name, |
| 38 |
timeout=timeout, |
| 39 |
**kwargs |
| 40 |
) |
| 41 |
|
| 42 |
id = Instrument.measurement( |
| 43 |
"*IDN?", """Get the instrument identification """ |
| 44 |
) |
| 45 |
|
| 46 |
config = Instrument.measurement( |
| 47 |
"SHOW ALL", |
| 48 |
"""Get the configuration """, |
| 49 |
) |
| 50 |
|
| 51 |
frequency = Instrument.control( |
| 52 |
"SH FR", "FR %.1f", |
| 53 |
"""Control test frequency used for the measurements. Allowed are values between |
| 54 |
50 and 20000 Hz. The device selects the closest possible frequency to |
| 55 |
the given value.""", |
| 56 |
validator=strict_range, |
| 57 |
values=[50, 20000], |
| 58 |
# typical reply: "FREQUENCY 1200.0 Hz" |
| 59 |
get_process=lambda v: float(AH2500A._renumeric.search(v).group(0)), |
| 60 |
) |
| 61 |
|
| 62 |
def reset(self): |
| 63 |
""" Resets the instrument. """ |
| 64 |
self.write("*RST") |
| 65 |
|
| 66 |
def trigger(self): |
| 67 |
""" |
| 68 |
Triggers a new measurement without blocking and waiting for the return |
| 69 |
value. |
| 70 |
""" |
| 71 |
self.write("*TRG") |
| 72 |
self._triggered = True |