Debian Codegraph @

pymeasure/instruments/advantest/advantestR3767CG.py

raw
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, SCPIUnknownMixin
26 from pymeasure.instruments.validators import strict_range
27
28
29 class AdvantestR3767CG(SCPIUnknownMixin, Instrument):
30 """ Represents the Advantest R3767CG VNA. Implements controls to change the analysis
31 range and to retrieve the data for the trace.
32 """
33
34 def __init__(self, adapter, name="Advantest R3767CG", **kwargs):
35 super().__init__(
36 adapter,
37 name,
38 **kwargs
39 )
40
41 # Tell unit to operate in IEEE488.2-1987 command mode.
42 self.write("OLDC OFF")
43
44 id = Instrument.measurement(
45 "*IDN?", """Get the instrument identification."""
46 )
47
48 center_frequency = Instrument.control(
49 ":FREQ:CENT?", ":FREQ:CENT %d",
50 """Control the center Frequency in Hz.""",
51 validator=strict_range,
52 values=[300000, 8000000000]
53 )
54
55 span_frequency = Instrument.control(
56 ":FREQ:SPAN?", ":FREQ:SPAN %d",
57 """Control the frequency span in Hz.""",
58 validator=strict_range,
59 values=[1, 8000000000]
60 )
61
62 start_frequency = Instrument.control(
63 ":FREQ:STAR?", ":FREQ:STAR %d",
64 """Control the starting frequency in Hz.""",
65 validator=strict_range,
66 values=[1, 8000000000]
67 )
68
69 stop_frequency = Instrument.control(
70 ":FREQ:STOP?", ":FREQ:STOP %d",
71 """Control the stopping frequency in Hz.""",
72 validator=strict_range,
73 values=[1, 8000000000]
74 )
75
76 trace_1 = Instrument.measurement(
77 "TRAC:DATA? FDAT1", """Get the data array from trace 1 after formatting."""
78 )