Debian Codegraph @

tests/instruments/aimtti/test_PL303QMDP_with_device.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 import time
25 import pytest
26
27 from pymeasure.instruments.aimtti.aimttiPL import PL303QMDP
28
29
30 @pytest.fixture(scope="module")
31 def psu(connected_device_address):
32 instr = PL303QMDP(connected_device_address)
33 instr.reset()
34 return instr
35
36
37 def test_voltage(psu):
38 psu.ch_2.voltage_setpoint = 1.2
39 psu.ch_2.current_limit = 1.0
40 psu.ch_2.current_range = "HIGH"
41 psu.ch_2.output_enabled = True
42
43 time.sleep(1)
44
45 print(psu.ch_2.voltage)
46
47 time.sleep(5)
48
49 psu.ch_2.output_enabled = False
50
51
52 def test_voltage_all(psu):
53 psu.ch_2.voltage_setpoint = 1.2
54 psu.ch_2.current_limit = 1.0
55
56 psu.ch_1.voltage_setpoint = 24.0
57 psu.ch_1.current_limit = 1.2
58
59 psu.all_outputs_enabled = True
60
61 time.sleep(5)
62
63 psu.all_outputs_enabled = False
64 psu.local()