Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IC-Interface Control
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mateus Goto
IC-Interface Control
Commits
8797f7f3
Commit
8797f7f3
authored
Jun 21, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADDED] Recv and check erros functions
parent
9d487347
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
NHR9400/NRH9400.py
NHR9400/NRH9400.py
+26
-4
Utility/refineOutput.py
Utility/refineOutput.py
+2
-2
No files found.
NHR9400/NRH9400.py
View file @
8797f7f3
import
random
import
socket
from
Utility
import
IPFinder
from
Utility
import
IPFinder
,
RefineOutput
class
NHR9400
:
...
...
@@ -8,21 +9,42 @@ class NHR9400:
self
.
__name
=
name
self
.
__s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
__s
.
timeout
(
1
)
pass
self
.
__out
=
RefineOutput
def
setIp
(
self
):
pass
def
getIp
(
self
):
pass
#Function that receives messages back and transform it in a string
def
receiveString
(
self
):
msg
=
self
.
__s
.
recv
(
1024
)
msg
=
self
.
__out
.
RefineOutput
.
byteToString
(
msg
)
return
msg
#Function that receives messages back and transform it in a float
def
receiveFloat
(
self
):
msg
=
self
.
__s
.
recv
(
1024
)
msg
=
self
.
__out
.
RefineOutput
.
byteToFloat
(
msg
)
return
msg
def
identify
(
self
):
self
.
__s
.
send
(
"*IDN?
\n
"
)
return
self
.
receive
()
def
checkErrors
(
self
):
self
.
__s
.
send
(
"SYST:ERR?
\n
"
)
return
self
.
receive
()
#Function to see if exist any error in the carry
def
checkErrors
(
self
):
self
.
__s
.
send
(
"SYSTem:ERRor?"
)
#set limit voltage of all
channel
s
#set limit voltage of all
phase
s
def
setVoltage
(
self
,
voltage
):
self
.
__s
.
send
(
"SOUR:VOLT "
+
voltage
+
"
\n
"
)
#set the current of all phases ** Available only to NHR9430-12
def
setCurrent
(
self
,
current
):
self
.
__s
.
send
(
"SOUR:CURR "
+
current
+
"
\n
"
)
...
...
Utility/refineOutput.py
View file @
8797f7f3
class
r
efineOutput
:
class
R
efineOutput
:
def
byteToFloat
(
recv
):
recv
=
recv
.
decode
(
"UTF-8"
)
...
...
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