-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_FugSource.py
More file actions
42 lines (31 loc) · 820 Bytes
/
test_FugSource.py
File metadata and controls
42 lines (31 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# (c) 2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod
import FugSource
if __name__ == "__main__":
"""
Test code for the FugSource class.
"""
# create the object
data = dict()
data["ip"] = "xxx.xx.xx.x"
data["port"] = 2101
data["timeout"] = 0.01
data["buffer"] = 1024
data["delay_send"] = 0.01
data["delay_wait"] = 1.0
data["delay_loop"] = 0.01
obj = FugSource.FugSource(data)
# connect to the device
obj.open()
# enable the voltage source
obj.enable()
# set the current limit
obj.set_I(0.5)
# set the voltage
obj.set_I(800)
# read the voltage and current
value = obj.get_V()
value = obj.get_I()
# disable the voltage source
obj.disable()
# disconnect from the device
obj.close()