Debian Codegraph @

pymeasure/instruments/tdk/tdk_gen40_38.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 # =============================================================================
26 # Libraries / modules
27 # =============================================================================
28
29 from .tdk_base import TDK_Lambda_Base
30
31
32 # =============================================================================
33 # Instrument file
34 # =============================================================================
35
36
37 class TDK_Gen40_38(TDK_Lambda_Base):
38 """
39 Represents the TDK Lambda Genesys 40-38 DC power supply. Class inherits
40 commands from the TDK_Lambda_Base parent class and utilizes dynamic
41 properties adjust valid values on various properties.
42
43 .. code-block:: python
44
45 psu = TDK_Gen40_38("COM3", 6) # COM port and daisy-chain address
46 psu.remote = "REM" # PSU in remote mode
47 psu.output_enabled = True # Turn on output
48 psu.ramp_to_current(2.0) # Ramp to 2.0 A of current
49 print(psu.current) # Measure actual PSU current
50 print(psu.voltage) # Measure actual PSU voltage
51 psu.shutdown() # Run shutdown command
52
53 The initialization of a TDK instrument requires the current address
54 of the TDK power supply. The default address for the TDK Lambda is 6.
55
56 :param adapter: VISAAdapter instance
57 :param name: Instrument name. Default is "TDK Lambda Gen40-38"
58 :param address: Serial port daisy chain number. Default is 6.
59 """
60
61 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62 # Dynamic values - Overrides base class validator values
63 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
65 voltage_values = [0, 40]
66 current_values = [0, 38]
67 over_voltage_values = [2, 44]
68 under_voltage_values = [0, 38]
69
70 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71 # Initializer
72 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73
74 def __init__(self, adapter, name="TDK Lambda Gen40-38", address=6,
75 **kwargs):
76 super().__init__(
77 adapter,
78 name,
79 address,
80 **kwargs
81 )