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
10fe7b30
Commit
10fe7b30
authored
Jan 11, 2024
by
joao-santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Updated] Add 9430 to NHR project
parent
3b3c8ed8
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
456 additions
and
43 deletions
+456
-43
Control_Interface/__pycache__/controlInterface.cpython-310.pyc
...ol_Interface/__pycache__/controlInterface.cpython-310.pyc
+0
-0
Control_Interface/controlInterface.py
Control_Interface/controlInterface.py
+1
-1
LabREI-1705004014465.json
LabREI-1705004014465.json
+427
-29
NHR9400series/NHR9400.py
NHR9400series/NHR9400.py
+2
-3
NHR9400series/NHR9430.py
NHR9400series/NHR9430.py
+5
-0
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
+0
-0
NHR9400series/__pycache__/NHR9430.cpython-310.pyc
NHR9400series/__pycache__/NHR9430.cpython-310.pyc
+0
-0
main.py
main.py
+21
-10
No files found.
Control_Interface/__pycache__/controlInterface.cpython-310.pyc
View file @
10fe7b30
No preview for this file type
Control_Interface/controlInterface.py
View file @
10fe7b30
...
...
@@ -6,7 +6,7 @@ from UtilitiesRei.IPFinder import IPFinder
class
controlInterface
:
def
__init__
(
self
):
self
.
__listIp
=
[
'192.168.0.150'
]
self
.
__listIp
=
[
'192.168.0.150'
,
'192.168.0.151'
]
self
.
__listUsedIp
=
[]
self
.
__nhr9410
=
[]
self
.
__nhr9430
=
[]
...
...
LabREI-1
698857889340
.json
→
LabREI-1
705004014465
.json
View file @
10fe7b30
This diff is collapsed.
Click to expand it.
NHR9400series/NHR9400.py
View file @
10fe7b30
...
...
@@ -548,11 +548,10 @@ class NHR9400():
#Fetch the average current of all channels
def
getCurrent
(
self
):
self
.
__s
.
send
(
"
FECT:
CURR?
\n
"
.
encode
())
self
.
__s
.
send
(
"CURR?
\n
"
.
encode
())
value
=
self
.
__s
.
recv
(
1024
)
print
(
value
.
decode
())
print
(
value
)
return
self
.
receiveFloat
(
value
)
#fetch individual value of current of one channel
def
getCurrentA
(
self
):
self
.
__s
.
send
(
"FETC:CURR:APHase?
\n
"
.
encode
())
...
...
NHR9400series/NHR9430.py
View file @
10fe7b30
...
...
@@ -65,6 +65,11 @@ class NHR9430(NHR9400):
value
=
self
.
__s
.
recv
(
1024
)
return
self
.
receiveArray
(
value
)
def
getCurrent
(
self
):
self
.
__s
.
send
(
"CURR?
\n
"
.
encode
())
value
=
self
.
__s
.
recv
(
1024
)
return
self
.
receiveFloat
(
value
)
###################### Instrument Capabilities #################
#Query returns the minimum and maximum allowable set value for crest factor in NORMal loading mode Refer to CONFigure:LOAD:MODE for information about setting the 9430 in NORmal loading mode.
...
...
NHR9400series/__pycache__/NHR9400.cpython-310.pyc
View file @
10fe7b30
No preview for this file type
NHR9400series/__pycache__/NHR9430.cpython-310.pyc
View file @
10fe7b30
No preview for this file type
main.py
View file @
10fe7b30
...
...
@@ -38,7 +38,7 @@ interface.newNhr("9430")
NHRs
=
{
"9410"
:
interface
.
getNhr9410
()[
0
],
#
"9430" : interface.getNhr9430()[0],
"9430"
:
interface
.
getNhr9430
()[
0
],
}
def
on_connect
(
client
,
userdata
,
flags
,
rc
):
...
...
@@ -134,14 +134,14 @@ def connect_mqtt():
def
publish
(
client
):
while
not
FLAG_EXIT
:
for
nhr_id
,
nhr_instance
in
NHRs
.
items
():
voltage
=
nhr_instance
.
getVoltage
()
freq
=
nhr_instance
.
getFreq
()
voltage
=
NHRs
[
"9410"
].
getVoltage
()
freq
=
NHRs
[
"9410"
].
getFreq
()
curr
=
NHRs
[
"9430"
].
getCurrent
()
data
=
[
{
"measurement"
:
"mqtt_consumer"
,
"tags"
:
{
"nhr"
:
nhr_id
,
"nhr"
:
"9410"
,
"method"
:
"Voltage"
},
"time"
:
datetime
.
datetime
.
utcnow
().
isoformat
(),
...
...
@@ -152,13 +152,24 @@ def publish(client):
{
"measurement"
:
"mqtt_consumer"
,
"tags"
:
{
"nhr"
:
nhr_id
,
"nhr"
:
"9410"
,
"method"
:
"Freq"
},
"time"
:
datetime
.
datetime
.
utcnow
().
isoformat
(),
"fields"
:
{
"value"
:
str
(
freq
)
}
},
{
"measurement"
:
"mqtt_consumer"
,
"tags"
:
{
"nhr"
:
"9430"
,
"method"
:
"Curr"
},
"time"
:
datetime
.
datetime
.
utcnow
().
isoformat
(),
"fields"
:
{
"value"
:
str
(
curr
)
}
}
]
client_influxdb
.
write_points
(
data
)
...
...
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