Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT reliability studies project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT reliability studies project
Commits
e488e1f7
Commit
e488e1f7
authored
Apr 06, 2022
by
Alén Arias Vázquez
😎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added option to use both channels
parent
c698cd5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
cpx400dp.py
cpx400dp/cpx400dp.py
+18
-3
No files found.
cpx400dp/cpx400dp.py
View file @
e488e1f7
...
...
@@ -64,18 +64,28 @@ class CPX400DP(object):
cmd
=
'IFLOCK
\n
'
self
.
send_cmd
(
cmd
)
def
turn_on
(
self
,
chan
=
1
):
def
turn_on
_chan
(
self
,
chan
=
1
):
cmd
=
'OP'
+
str
(
chan
)
+
' 1
\n
'
self
.
log
.
info
(
"Turning ON Channel {}"
.
format
(
chan
))
self
.
send_cmd
(
cmd
)
self
.
CHAN_STATUS
[
chan
-
1
]
=
True
def
turn_off
(
self
,
chan
=
1
):
def
turn_off
_chan
(
self
,
chan
=
1
):
cmd
=
'OP'
+
str
(
chan
)
+
' 0
\n
'
self
.
log
.
info
(
"Turning OFF Channel {}"
.
format
(
chan
))
self
.
send_cmd
(
cmd
)
self
.
CHAN_STATUS
[
chan
-
1
]
=
False
def
turn_on
(
self
):
self
.
log
.
info
(
"Turning On Both Channels"
)
self
.
turn_on_chan
(
chan
=
1
)
self
.
turn_on_chan
(
chan
=
2
)
def
turn_off
(
self
):
self
.
log
.
info
(
"Turning Off Both Channels"
)
self
.
turn_off_chan
(
chan
=
1
)
self
.
turn_off_chan
(
chan
=
2
)
def
get_status_chan
(
self
,
chan
=
1
):
cmd
=
'OP'
+
str
(
chan
)
+
'?
\n
'
self
.
send_cmd
(
cmd
)
...
...
@@ -97,6 +107,11 @@ class CPX400DP(object):
self
.
set_current
(
amps
=
amps
,
chan
=
chan
)
self
.
turn_on
(
chan
=
chan
)
def
setup
(
self
,
volts_1
=
10.0
,
amps_1
=
0.3
,
volts_2
=
10.0
,
amps_2
=
0.3
):
self
.
log
.
info
(
"Setup Both Channels"
)
self
.
setup_chan
(
self
,
chan
=
1
,
volts
=
volts_1
,
amps
=
amps_1
)
self
.
setup_chan
(
self
,
chan
=
2
,
volts
=
volts_2
,
amps
=
amps_2
)
def
get_parameters_chan
(
self
,
chan
=
1
):
V
=
self
.
get_voltage
(
chan
=
chan
)
I
=
self
.
get_current
(
chan
=
chan
)
...
...
@@ -122,7 +137,7 @@ def main():
if
args
.
powerup
:
psu
.
setup_chan
(
chan
=
args
.
chan
,
volts
=
args
.
volts
,
amps
=
args
.
amps
)
else
:
psu
.
turn_off
(
chan
=
args
.
chan
)
psu
.
turn_off
_chan
(
chan
=
args
.
chan
)
psu
.
close
()
if
__name__
==
'__main__'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment