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
9d487347
Commit
9d487347
authored
Jun 20, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ADDED] refined outputs and more setters
parent
b63a2131
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
NHR9400/NRH9400.py
NHR9400/NRH9400.py
+10
-6
Utility/refineOutput.py
Utility/refineOutput.py
+10
-0
No files found.
NHR9400/NRH9400.py
View file @
9d487347
...
@@ -5,27 +5,31 @@ from Utility import IPFinder
...
@@ -5,27 +5,31 @@ from Utility import IPFinder
class
NHR9400
:
class
NHR9400
:
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
):
self
.
__id
=
random
.
randrange
(
100
,
300
,
2
)
self
.
__name
=
name
self
.
__name
=
name
self
.
__s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
__s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
__s
.
timeout
(
1
)
self
.
__s
.
timeout
(
1
)
pass
def
setIp
(
self
):
def
setIp
(
self
):
pass
pass
def
getIp
(
self
):
pass
#Function to see if exist any error in the carry
#Function to see if exist any error in the carry
def
checkErrors
(
self
):
def
checkErrors
(
self
):
self
.
__s
.
send
(
"SYSTem:ERRor?"
)
self
.
__s
.
send
(
"SYSTem:ERRor?"
)
#set limit voltage of all channels
#set limit voltage of all channels
def
setVoltage
(
self
,
voltage
):
def
setVoltage
(
self
,
voltage
):
self
.
__s
.
send
(
"VOLT "
+
voltage
+
"
\n
"
)
self
.
__s
.
send
(
"
SOUR:
VOLT "
+
voltage
+
"
\n
"
)
def
setCurrent
(
self
,
current
):
def
setCurrent
(
self
,
current
):
self
.
__s
.
send
(
"CURR "
+
current
+
"
\n
"
)
self
.
__s
.
send
(
"SOUR:CURR "
+
current
+
"
\n
"
)
def
setPower
():
def
setPower
(
self
,
pow
):
def
setFreq
():
self
.
__s
.
send
(
"SOUR:POW "
+
pow
+
"
\n
"
)
def
setFreq
(
self
,
freq
):
self
.
__s
.
send
(
"SOUR:POW "
+
freq
+
"
\n
"
)
def
getVoltage
(
self
):
def
getVoltage
(
self
):
value
=
self
.
__s
.
send
(
"FETCh:VOLTage?"
)
value
=
self
.
__s
.
send
(
"FETCh:VOLTage?"
)
...
...
Utility/refineOutput.py
0 → 100644
View file @
9d487347
class
refineOutput
:
def
byteToFloat
(
recv
):
recv
=
recv
.
decode
(
"UTF-8"
)
recv
=
recv
.
rstrip
(
"
\n\x00
"
)
return
float
(
recv
)
def
byteToString
(
recv
):
recv
=
recv
.
decode
(
"UTF-8"
)
return
recv
\ No newline at end of file
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