Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noise_python_scripts
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python_Scripts_For_Embedded_Developer
noise_python_scripts
Commits
3d0d4a50
Commit
3d0d4a50
authored
Dec 14, 2023
by
aohui.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理归类文档、上传厂商配置软件和产品说明
parent
7c2c3b97
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
30 additions
and
28 deletions
+30
-28
noiseLab.jpg
Picture/noiseLab.jpg
+0
-0
noiseLab数据转换图形.png
Picture/noiseLab数据转换图形.png
+0
-0
传感器采集平台显示截图.png
Picture/传感器采集平台显示截图.png
+0
-0
README.md
README.md
+26
-13
【测试】噪音传感器测试报告.pdf
TestReport/【测试】噪音传感器测试报告.pdf
+0
-0
上洛传感噪音传感器产品手册(RS485)-V1.3.pdf
...cturer_config_software/说明手册/上洛传感噪音传感器产品手册(RS485)-V1.3.pdf
+0
-0
兆泰盛板载噪声模块.doc
manufacturer_config_software/说明手册/兆泰盛板载噪声模块.doc
+0
-0
建大噪声变送器485型使用说明书.pdf
manufacturer_config_software/说明手册/建大噪声变送器485型使用说明书.pdf
+0
-0
[上洛]08-噪音传感器调试软件.exe
manufacturer_config_software/配置软件/[上洛]08-噪音传感器调试软件.exe
+0
-0
[兆泰盛]485参数配置工具V600.exe
manufacturer_config_software/配置软件/[兆泰盛]485参数配置工具V600.exe
+0
-0
[建大]485参数配置工具V5.0.7.12.exe
manufacturer_config_software/配置软件/[建大]485参数配置工具V5.0.7.12.exe
+0
-0
main.py
python_scripts/main.py
+1
-14
myMqtt.py
python_scripts/module/myMqtt.py
+0
-0
noiseLab_dataProcess.py
python_scripts/noiseLab_dataProcess.py
+3
-1
Motor.csv
python_scripts/noise_data/Motor.csv
+0
-0
_1KHz.csv
python_scripts/noise_data/_1KHz.csv
+0
-0
result_noise_data.png
result_noise_data.png
+0
-0
No files found.
Pic/noiseLab.jpg
→
Pic
ture
/noiseLab.jpg
View file @
3d0d4a50
File moved
Pic/noiseLab数据转换图形.png
→
Pic
ture
/noiseLab数据转换图形.png
View file @
3d0d4a50
File moved
Pic/传感器采集平台显示截图.png
→
Pic
ture
/传感器采集平台显示截图.png
View file @
3d0d4a50
File moved
README.md
View file @
3d0d4a50
# 使用说明
## python main.py 脚本
### 环境
# 模块说明
## I. 厂商配置软件
路径:
`./manufacturer_config_software/配置软件`
## II. 产品手册
路径:
`./manufacturer_config_software/说明手册`
# 脚本说明
## I. python main.py 脚本
### 1 环境
```
shell
pip
install
modbus-tk
pip
install
serial
...
...
@@ -10,14 +21,14 @@ pip install paho-mqtt
```
### 配置COM口
###
2
配置COM口
`SerialCom = 'COM5'`
### 上发主题
###
3
上发主题
`WT/WTG93RF/99991213/opData`
### 控制对应噪音传感器上发数据
###
4
控制对应噪音传感器上发数据
```
python
# Enable sensor
enableJianDa
=
1
#开启采集
...
...
@@ -25,17 +36,19 @@ enableShangLuo = 0 #关闭采集
enableZhaotai
=
1
```
### 数据查询页
###
5
数据查询页
[
Witium 测试平台
](
http://gm.cloud.witium.com.cn/#/app/dataMonitor/gearMotorMonitor/monitorDetail?reducerNo=RN704134230753816576&reducerName=%E5%99%AA%E9%9F%B3%E6%B5%8B%E8%AF%95%E8%AE%BE%E5%A4%87&status=0&boundState=1
)


##
python noiseLab_dataDeal
.py脚本
-
会将data.csv的数据转换为图形;

##
II. python noiseLab_dataProcess
.py脚本
1.
noiseLab_dataProcess.py
会将data.csv的数据转换为图形;

##
App

2.
NoiseLab
App

# 测试报告
路径:
`./TestReport`
\ No newline at end of file
【测试】噪音传感器测试报告.pdf
→
TestReport/
【测试】噪音传感器测试报告.pdf
View file @
3d0d4a50
File moved
manufacturer_config_software/说明手册/上洛传感噪音传感器产品手册(RS485)-V1.3.pdf
0 → 100644
View file @
3d0d4a50
File added
manufacturer_config_software/说明手册/兆泰盛板载噪声模块.doc
0 → 100644
View file @
3d0d4a50
File added
manufacturer_config_software/说明手册/建大噪声变送器485型使用说明书.pdf
0 → 100644
View file @
3d0d4a50
File added
manufacturer_config_software/配置软件/[上洛]08-噪音传感器调试软件.exe
0 → 100644
View file @
3d0d4a50
File added
manufacturer_config_software/配置软件/[兆泰盛]485参数配置工具V600.exe
0 → 100644
View file @
3d0d4a50
File added
manufacturer_config_software/配置软件/[建大]485参数配置工具V5.0.7.12.exe
0 → 100644
View file @
3d0d4a50
File added
main.py
→
python_scripts/
main.py
View file @
3d0d4a50
...
...
@@ -44,26 +44,13 @@ class Sensor:
self
.
__master
.
set_timeout
(
2
,
use_sw_timeout
=
True
)
except
Exception
as
exp
:
print
(
exp
)
exit
(
1
)
def
get_noise
(
self
,
noise_sensor_idx
):
noise_sensor_idx
-=
1
data
=
self
.
__master
.
execute
(
noise_Message
[
noise_sensor_idx
][
0
],
cst
.
READ_HOLDING_REGISTERS
,
noise_Message
[
noise_sensor_idx
][
1
],
1
)
return
data
def
getNoise
(
sendData
):
ser
.
write
(
bytes
(
sendData
))
time
.
sleep
(
0.5
)
# 需要等待
address
=
ser
.
read
(
1
)
# 读取地址字节
function_code
=
ser
.
read
(
1
)
# 读取功能码字节
data_length
=
ser
.
read
(
1
)
# 读取数据字节数字节
data
=
ser
.
read
(
2
)
crc
=
ser
.
read
(
2
)
# 读取CRC校验(2字节)
# 将字节串转换为整数
dB_data
=
int
.
from_bytes
(
data
,
byteorder
=
'big'
)
dB_data
=
dB_data
/
10.0
# trans dB
return
dB_data
S
=
Sensor
(
SerialCom
)
# ser = serial.Serial(SerialComTest, 4800, parity=serial.PARITY_NONE, bytesize=serial.EIGHTBITS, stopbits=serial.STOPBITS_ONE)
# data_to_send = [0x02,0x03,0x00,0x06,0x00, 0x01 ,0x64 ,0x38]
...
...
module/myMqtt.py
→
python_scripts/
module/myMqtt.py
View file @
3d0d4a50
File moved
noiseLab_dataDeal
.py
→
python_scripts/noiseLab_dataProcess
.py
View file @
3d0d4a50
...
...
@@ -3,7 +3,9 @@ import matplotlib.pyplot as plt
from
io
import
StringIO
file_path
=
'_1KHz.csv'
# file_path = './noise_data/Motor.csv'
file_path
=
'./noise_data/_1KHz.csv'
# Read data into a pandas DataFrame
df
=
pd
.
read_csv
(
file_path
,
sep
=
" "
,
parse_dates
=
[
"Time"
])
...
...
Motor.csv
→
python_scripts/noise_data/
Motor.csv
View file @
3d0d4a50
File moved
_1KHz.csv
→
python_scripts/noise_data/
_1KHz.csv
View file @
3d0d4a50
File moved
result_noise_data.png
deleted
100644 → 0
View file @
7c2c3b97
584 KB
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