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
Hide 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
{
"__inputs"
:
[],
"__requires"
:
[
{
"type"
:
"panel"
,
"id"
:
"geeksrus-mqtt-panel"
,
"name"
:
"MQTT panel"
,
"version"
:
"1.0.7"
},
{
"type"
:
"grafana"
,
"id"
:
"grafana"
,
"name"
:
"Grafana"
,
"version"
:
"7.5.3"
},
{
"type"
:
"panel"
,
"id"
:
"timeseries"
,
"name"
:
"Time series"
,
"version"
:
""
}
],
"annotations"
:
{
"list"
:
[
{
...
...
@@ -16,7 +37,7 @@
"editable"
:
true
,
"gnetId"
:
null
,
"graphTooltip"
:
0
,
"id"
:
1
,
"id"
:
null
,
"links"
:
[],
"panels"
:
[
{
...
...
@@ -27,7 +48,7 @@
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
3
,
"w"
:
4
,
"x"
:
0
,
"y"
:
0
},
...
...
@@ -90,7 +111,88 @@
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Enable"
,
"title"
:
"NHR Enable 9410"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
"1"
,
"viewModel"
:
{
"maxValue"
:
"100"
,
"minValue"
:
"0"
,
"step"
:
"1"
,
"text"
:
"Enable"
}
},
{
"datasource"
:
null
,
"fieldConfig"
:
{
"defaults"
:
{},
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
4
,
"x"
:
4
,
"y"
:
0
},
"id"
:
14
,
"mode"
:
"Button"
,
"model"
:
{
"maxValue"
:
100
,
"minValue"
:
0
,
"offValue"
:
"false"
,
"onValue"
:
"true"
,
"step"
:
1
,
"text"
:
"Enable"
},
"mqttAuth"
:
"None"
,
"mqttPassword"
:
""
,
"mqttProtocol"
:
"wss"
,
"mqttServer"
:
"broker.hivemq.com"
,
"mqttServerPort"
:
"8884/mqtt"
,
"mqttTopicPublish"
:
"labrei-nhr-sub/9430/enableOutput"
,
"mqttTopicQuery"
:
""
,
"mqttTopicSubscribe"
:
"labrei-nhr-pub"
,
"mqttUser"
:
""
,
"pluginVersion"
:
"7.5.3"
,
"targets"
:
[
{
"groupBy"
:
[
{
"params"
:
[
"$__interval"
],
"type"
:
"time"
},
{
"params"
:
[
"null"
],
"type"
:
"fill"
}
],
"orderByTime"
:
"ASC"
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"value"
],
"type"
:
"field"
},
{
"params"
:
[],
"type"
:
"mean"
}
]
],
"tags"
:
[]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Enable 9430"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
"1"
,
"viewModel"
:
{
...
...
@@ -108,8 +210,8 @@
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
3
,
"x"
:
3
,
"w"
:
4
,
"x"
:
8
,
"y"
:
0
},
"id"
:
8
,
...
...
@@ -171,7 +273,7 @@
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Disable"
,
"title"
:
"NHR Disable
9410
"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
"0"
,
"viewModel"
:
{
...
...
@@ -189,10 +291,91 @@
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
7
,
"x"
:
6
,
"w"
:
4
,
"x"
:
12
,
"y"
:
0
},
"id"
:
15
,
"mode"
:
"Button"
,
"model"
:
{
"maxValue"
:
100
,
"minValue"
:
0
,
"offValue"
:
"false"
,
"onValue"
:
"true"
,
"step"
:
1
,
"text"
:
"Disable"
},
"mqttAuth"
:
"None"
,
"mqttPassword"
:
""
,
"mqttProtocol"
:
"wss"
,
"mqttServer"
:
"broker.hivemq.com"
,
"mqttServerPort"
:
"8884/mqtt"
,
"mqttTopicPublish"
:
"labrei-nhr-sub/9430/enableOutput"
,
"mqttTopicQuery"
:
""
,
"mqttTopicSubscribe"
:
"labrei-nhr-pub"
,
"mqttUser"
:
""
,
"pluginVersion"
:
"7.5.3"
,
"targets"
:
[
{
"groupBy"
:
[
{
"params"
:
[
"$__interval"
],
"type"
:
"time"
},
{
"params"
:
[
"null"
],
"type"
:
"fill"
}
],
"orderByTime"
:
"ASC"
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"value"
],
"type"
:
"field"
},
{
"params"
:
[],
"type"
:
"mean"
}
]
],
"tags"
:
[]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Disable 9430"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
"0"
,
"viewModel"
:
{
"maxValue"
:
"100"
,
"minValue"
:
"0"
,
"step"
:
"1"
,
"text"
:
"Disable"
}
},
{
"datasource"
:
null
,
"fieldConfig"
:
{
"defaults"
:
{},
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
7
,
"x"
:
0
,
"y"
:
3
},
"id"
:
9
,
"mode"
:
"Text"
,
"model"
:
{
...
...
@@ -252,16 +435,16 @@
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Set Voltage"
,
"title"
:
"NHR Set Voltage
9410
"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
{
"type"
:
"Buffer"
,
"data"
:
[
110
,
117
,
108
,
108
],
"type"
:
"Buffer"
]
},
"viewModel"
:
{
"maxValue"
:
"100"
,
...
...
@@ -279,8 +462,97 @@
"gridPos"
:
{
"h"
:
3
,
"w"
:
7
,
"x"
:
13
,
"y"
:
0
"x"
:
7
,
"y"
:
3
},
"id"
:
16
,
"mode"
:
"Text"
,
"model"
:
{
"maxValue"
:
100
,
"minValue"
:
0
,
"offValue"
:
"false"
,
"onValue"
:
"true"
,
"step"
:
1
,
"text"
:
"Send"
},
"mqttAuth"
:
"None"
,
"mqttPassword"
:
""
,
"mqttProtocol"
:
"wss"
,
"mqttServer"
:
"broker.hivemq.com"
,
"mqttServerPort"
:
"8884/mqtt"
,
"mqttTopicPublish"
:
"labrei-nhr-sub/9430/setCurrent"
,
"mqttTopicQuery"
:
""
,
"mqttTopicSubscribe"
:
"labrei-nhr-pub"
,
"mqttUser"
:
""
,
"pluginVersion"
:
"7.5.3"
,
"targets"
:
[
{
"groupBy"
:
[
{
"params"
:
[
"$__interval"
],
"type"
:
"time"
},
{
"params"
:
[
"null"
],
"type"
:
"fill"
}
],
"orderByTime"
:
"ASC"
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"value"
],
"type"
:
"field"
},
{
"params"
:
[],
"type"
:
"mean"
}
]
],
"tags"
:
[]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Set Current 9430"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
{
"type"
:
"Buffer"
,
"data"
:
[
110
,
117
,
108
,
108
]
},
"viewModel"
:
{
"maxValue"
:
"100"
,
"minValue"
:
"0"
,
"step"
:
"1"
,
"text"
:
"Send"
}
},
{
"datasource"
:
null
,
"fieldConfig"
:
{
"defaults"
:
{},
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
3
,
"w"
:
7
,
"x"
:
14
,
"y"
:
3
},
"id"
:
10
,
"mode"
:
"Text"
,
...
...
@@ -341,16 +613,16 @@
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"NHR Set Frequency"
,
"title"
:
"NHR Set Frequency
9410
"
,
"type"
:
"geeksrus-mqtt-panel"
,
"value"
:
{
"type"
:
"Buffer"
,
"data"
:
[
110
,
117
,
108
,
108
],
"type"
:
"Buffer"
]
},
"viewModel"
:
{
"maxValue"
:
"100"
,
...
...
@@ -406,12 +678,12 @@
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
8
,
"w"
:
1
2
,
"h"
:
7
,
"w"
:
1
0
,
"x"
:
0
,
"y"
:
3
"y"
:
6
},
"id"
:
1
2
,
"id"
:
1
7
,
"options"
:
{
"graph"
:
{},
"legend"
:
{
...
...
@@ -464,13 +736,19 @@
"key"
:
"method"
,
"operator"
:
"="
,
"value"
:
"Voltage"
},
{
"condition"
:
"AND"
,
"key"
:
"nhr"
,
"operator"
:
"="
,
"value"
:
"9410"
}
]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"Voltage"
,
"title"
:
"Voltage
9410
"
,
"type"
:
"timeseries"
},
{
...
...
@@ -515,15 +793,15 @@
}
]
},
"unit"
:
"
rothz
"
"unit"
:
"
amp
"
},
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
8
,
"w"
:
1
2
,
"x"
:
1
2
,
"y"
:
3
"h"
:
7
,
"w"
:
1
0
,
"x"
:
1
0
,
"y"
:
6
},
"id"
:
13
,
"options"
:
{
...
...
@@ -577,20 +855,140 @@
{
"key"
:
"nhr"
,
"operator"
:
"="
,
"value"
:
"94
1
0"
"value"
:
"94
3
0"
},
{
"condition"
:
"AND"
,
"key"
:
"method"
,
"operator"
:
"="
,
"value"
:
"Curr"
}
]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"Current 9430"
,
"type"
:
"timeseries"
},
{
"datasource"
:
null
,
"fieldConfig"
:
{
"defaults"
:
{
"color"
:
{
"mode"
:
"palette-classic"
},
"custom"
:
{
"axisLabel"
:
""
,
"axisPlacement"
:
"auto"
,
"barAlignment"
:
0
,
"drawStyle"
:
"line"
,
"fillOpacity"
:
10
,
"gradientMode"
:
"none"
,
"hideFrom"
:
{
"graph"
:
false
,
"legend"
:
false
,
"tooltip"
:
false
},
"lineInterpolation"
:
"linear"
,
"lineWidth"
:
1
,
"pointSize"
:
5
,
"scaleDistribution"
:
{
"type"
:
"linear"
},
"showPoints"
:
"never"
,
"spanNulls"
:
true
},
"mappings"
:
[],
"thresholds"
:
{
"mode"
:
"absolute"
,
"steps"
:
[
{
"color"
:
"green"
,
"value"
:
null
},
{
"color"
:
"red"
,
"value"
:
80
}
]
},
"unit"
:
"rothz"
},
"overrides"
:
[]
},
"gridPos"
:
{
"h"
:
7
,
"w"
:
10
,
"x"
:
0
,
"y"
:
13
},
"id"
:
12
,
"options"
:
{
"graph"
:
{},
"legend"
:
{
"calcs"
:
[],
"displayMode"
:
"hidden"
,
"placement"
:
"bottom"
},
"tooltipOptions"
:
{
"mode"
:
"single"
}
},
"pluginVersion"
:
"7.5.3"
,
"targets"
:
[
{
"groupBy"
:
[
{
"params"
:
[
"$__interval"
],
"type"
:
"time"
},
{
"params"
:
[
"null"
],
"type"
:
"fill"
}
],
"measurement"
:
"mqtt_consumer"
,
"orderByTime"
:
"ASC"
,
"policy"
:
"default"
,
"refId"
:
"A"
,
"resultFormat"
:
"time_series"
,
"select"
:
[
[
{
"params"
:
[
"value"
],
"type"
:
"field"
},
{
"params"
:
[],
"type"
:
"last"
}
]
],
"tags"
:
[
{
"key"
:
"method"
,
"operator"
:
"="
,
"value"
:
"Freq"
},
{
"condition"
:
"AND"
,
"key"
:
"nhr"
,
"operator"
:
"="
,
"value"
:
"9410"
}
]
}
],
"timeFrom"
:
null
,
"timeShift"
:
null
,
"title"
:
"Frequency "
,
"title"
:
"Frequency
9410
"
,
"type"
:
"timeseries"
}
],
...
...
@@ -609,5 +1007,5 @@
"timezone"
:
""
,
"title"
:
"LabREI"
,
"uid"
:
"-SKl6PX4k"
,
"version"
:
4
"version"
:
6
}
\ No newline at end of file
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
()
data
=
[
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,17 +152,28 @@ 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
)
time
.
sleep
(
1
)
]
client_influxdb
.
write_points
(
data
)
time
.
sleep
(
1
)
...
...
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