-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetLEDBias.py
More file actions
executable file
·51 lines (39 loc) · 1.12 KB
/
setLEDBias.py
File metadata and controls
executable file
·51 lines (39 loc) · 1.12 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
#!/usr/bin/env python3
from Lab5015_utils import AgilentE3633A
from Lab5015_utils import Keithley2231A
from optparse import OptionParser
import time
parser = OptionParser()
parser.add_option("--power", dest="power", default="0")
parser.add_option("--target", dest="target", default="0")
(options,args)=parser.parse_args()
#ps = AgilentE3633A()
ps = Keithley2231A('ASRL/dev/keithley2231A-1::INSTR', 'CH2')
state = ps.check_state()
if state == 0 and options.power == '1':
#ps.set_range('HIGH')
#time.sleep(1)
ps.set_V(float(options.target))
time.sleep(0.2)
ps.set_state(1)
curr = ps.meas_I()
volt = ps.meas_V()
state = ps.check_state()
print(state,volt,curr)
if state == 1 and options.power == '1':
ps.set_V(float(options.target))
time.sleep(0.2)
curr = ps.meas_I()
volt = ps.meas_V()
state = ps.check_state()
print(state,volt,curr)
elif state == 1 and options.power == '0':
ps.set_V(0.)
#ps.set_state(0)
time.sleep(0.2)
curr = ps.meas_I()
volt = ps.meas_V()
state = ps.check_state()
print(state,volt,curr)
else:
print('do nothing')