# Simulate **Repository Path**: yangyize/simulate ## Basic Information - **Project Name**: Simulate - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-08-06 - **Last Updated**: 2021-08-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MODBUS-RTU设备模拟程序 该程序主要负责模拟通信主站、从站与物管平台之间的数据通信 ![概念图](https://img-blog.csdnimg.cn/91f83fdd6a9b4a9ab294747d4a50c1f9.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Vhc3lsb3ZlY3Nkbg==,size_3,color_FFFFFF,t_70#pic_center) --- ### 文件目录 - modbus_tk:modbus_tk库文件 - master.py:主站模拟程序 - slave.py:从站模拟程序 - server.py:HTTP服务器模拟程序 - config.py:主要配置信息 - utils.py:工具函数 --- ### 安装依赖 - 安装modbus_tk ``` pip install modbus_tk ``` - 安装fastapi ``` pip install fastapi pip install uvicorn[standard] ``` --- ### 简易启动 Win用户可直接运行start.bat批处理程序启动服务 ``` 直接打开start.bat ``` --- ### 项目启动 1. Win用户请自行安装Configure Virtual Serial Port Driver,后利用该软件创建三对虚拟串口对 ``` COM1 --------> COM2 COM3 --------> COM4 COM5 --------> COM6 ``` 2. 切换至项目目录,运行服务器模拟程序 ``` python server.py ``` 3. 运行从站模拟程序 ``` python slave.py ``` 4. 运行主站模拟程序 ``` python master.py ```