-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsimpleTest.py
More file actions
executable file
·66 lines (53 loc) · 1.24 KB
/
Copy pathsimpleTest.py
File metadata and controls
executable file
·66 lines (53 loc) · 1.24 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
import MP71077x
import time
from sys import argv
if len(argv) < 2:
print("Usage: python simpleTest.py <address>")
exit(0)
address = argv[1]
load = MP71077x.MP71077x(target_ip = address, verbosity=True)
load.openSocket()
load.setUpperVoltageLimit(30.00)
load.setUpperCurrentLimit(30.00)
try:
load.setCIcurrent(40.000, True)
except Exception as e:
print (e)
pass
load.setUpperCurrentLimit(40.00)
load.setCIcurrent(40.000, True)
time.sleep(1)
try:
load.setCVvoltage(40.000, True)
except Exception as e:
print (e)
pass
load.setUpperVoltageLimit(150.00)
load.setCVvoltage(150.000, True)
time.sleep(1)
load.setUpperPowerLimit(25.00)
try:
load.setCPpower(35.000, True)
except Exception as e:
print (e)
pass
load.setUpperPowerLimit(300.00)
load.setCPpower(300.000, True)
time.sleep(1)
load.setUpperResistanceLimit(133.00)
try:
load.setCRresistance(500.000, True)
except Exception as e:
print (e)
pass
load.setUpperResistanceLimit(7500.00)
load.setCRresistance(7500.000, True)
load.turnInputON(True)
time.sleep(2)
load.turnInputOFF(True)
print(load.getVoltageLimits())
print(load.getCurrentLimits())
print(load.getPowerLimits())
print(load.getResistanceLimits())
load.closeSocket()