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
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
João Santos
IC-Interface Control
Commits
f3c8295f
Commit
f3c8295f
authored
Aug 12, 2022
by
Mateus Goto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fixed] Reset on init and close to avoid errors
parent
55e4ca5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
NHR9400series/NHR9400.py
NHR9400series/NHR9400.py
+7
-4
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
+0
-0
main.py
main.py
+1
-1
No files found.
NHR9400series/NHR9400.py
View file @
f3c8295f
from
abc
import
abstractmethod
from
abc
import
abstractmethod
import
socket
import
socket
import
time
from
UtilitiesRei.refineOutput
import
refineOutput
from
UtilitiesRei.refineOutput
import
refineOutput
...
@@ -24,6 +25,7 @@ class NHR9400():
...
@@ -24,6 +25,7 @@ class NHR9400():
self
.
__s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
__s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
__s
.
connect
((
client
,
5025
))
self
.
__s
.
connect
((
client
,
5025
))
self
.
__s
.
send
(
"*RST"
.
encode
())
self
.
__s
.
send
(
"SYST:RWL
\n
"
.
encode
())
#Command to activate remote control and locking the touchscreen
self
.
__s
.
send
(
"SYST:RWL
\n
"
.
encode
())
#Command to activate remote control and locking the touchscreen
self
.
__s
.
send
(
"*IDN?
\n
"
.
encode
())
self
.
__s
.
send
(
"*IDN?
\n
"
.
encode
())
msg
=
self
.
__s
.
recv
(
1024
)
msg
=
self
.
__s
.
recv
(
1024
)
...
@@ -120,11 +122,10 @@ class NHR9400():
...
@@ -120,11 +122,10 @@ class NHR9400():
def
close
(
self
):
def
close
(
self
):
self
.
systWatchdogService
()
self
.
__s
.
send
(
"SOUR:OUTP:ON 0
\n
"
.
encode
())
self
.
__s
.
send
(
"SOUR:OUTP:ON 0
\n
"
.
encode
())
self
.
__s
.
send
(
"ABOR
\n
"
.
encode
())
self
.
__s
.
send
(
"ABOR
\n
"
.
encode
())
self
.
__s
.
send
(
"SYST:LOC
\n
"
.
encode
())
self
.
__s
.
send
(
"SYST:LOC
\n
"
.
encode
())
print
(
self
.
checkErrors
())
self
.
__s
.
close
()
self
.
__s
.
close
()
# Controle do relé de saída do hardware (LIGAR OU DESLIGAR)
# Controle do relé de saída do hardware (LIGAR OU DESLIGAR)
# 0 OFF - Instrumento desabilitado
# 0 OFF - Instrumento desabilitado
...
@@ -155,12 +156,14 @@ class NHR9400():
...
@@ -155,12 +156,14 @@ class NHR9400():
def
systWatchdogRobust
(
self
,
bool
):
def
systWatchdogRobust
(
self
,
bool
):
if
bool
!=
0
or
bool
!=
1
:
return
-
1
if
bool
!=
0
or
bool
!=
1
:
return
-
1
self
.
__s
.
send
((
"SYST:WATC:ROB "
+
str
(
bool
)
+
"
\n
"
).
encode
())
self
.
__s
.
send
((
"SYST:WATC:ROB "
+
str
(
bool
)
+
"
\n
"
).
encode
())
value
=
self
.
__s
.
recv
(
1024
)
self
.
__s
.
send
((
"*RST
\n
"
).
encode
()
)
return
self
.
receiveString
(
value
)
self
.
__s
.
send
(
"SYST:RWL
\n
"
.
encode
()
)
#Command resets watchdog timer
#Command resets watchdog timer
def
systWatchdogService
(
self
):
def
systWatchdogService
(
self
):
self
.
__s
.
send
((
"SYST:WATC:SERV
\n
"
).
encode
())
self
.
__s
.
send
((
"SYST:WATC:SERV
\n
"
).
encode
())
self
.
__s
.
send
((
"*RST
\n
"
).
encode
())
self
.
__s
.
send
(
"SYST:RWL
\n
"
.
encode
())
################################# Digital Subsystem ############################
################################# Digital Subsystem ############################
...
...
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
View file @
f3c8295f
No preview for this file type
main.py
View file @
f3c8295f
...
@@ -20,7 +20,7 @@ def main():
...
@@ -20,7 +20,7 @@ def main():
for
elem
in
nhr10
:
for
elem
in
nhr10
:
print
(
"nhr10 watch dog interval: "
,
elem
.
systWatchdogInterval
(
5
))
print
(
"nhr10 watch dog interval: "
,
elem
.
systWatchdogInterval
(
0
))
print
(
"nhr10 ip: "
,
elem
.
getIp
())
print
(
"nhr10 ip: "
,
elem
.
getIp
())
print
(
"nhr10 max current: "
,
elem
.
instrumentCapCurrent
())
print
(
"nhr10 max current: "
,
elem
.
instrumentCapCurrent
())
print
(
"nhr10 current range: "
,
elem
.
instrumentCapCurrentRange
())
print
(
"nhr10 current range: "
,
elem
.
instrumentCapCurrentRange
())
...
...
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