Commit 3d0d4a50 authored by aohui.li's avatar aohui.li

整理归类文档、上传厂商配置软件和产品说明

parent 7c2c3b97
# 使用说明
## 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)
![](./Pic/传感器采集平台显示截图.png)
![](./Picture/传感器采集平台显示截图.png)
## python noiseLab_dataDeal.py脚本
- 会将data.csv的数据转换为图形;
![](./Pic/noiseLab数据转换图形.png)
## II. python noiseLab_dataProcess.py脚本
1. noiseLab_dataProcess.py会将data.csv的数据转换为图形;
![](./Picture/noiseLab数据转换图形.png)
## App
![noiseLab App](./Pic/noiseLab.jpg)
2. NoiseLab App
![noiseLab App](./Picture/noiseLab.jpg)
# 测试报告
路径:`./TestReport`
\ No newline at end of file
......@@ -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]
......
......@@ -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"])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment