# plugin_s7_plc_snap7 **Repository Path**: wasome/plugin_s7_plc_snap7 ## Basic Information - **Project Name**: plugin_s7_plc_snap7 - **Description**: plugin-s7插件中使用 Snap7 开源库 - **Primary Language**: Unknown - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-05-16 - **Last Updated**: 2025-04-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Siemens S7 PLC plugin **注意**: 1. 本项目用于展示开发WA-IOT-EDGE的插件,不能保证达到用于生产环境的条件。用户在使用时,必须确保安全的操作环境!!! 2. 需要使用2024-05-26以后的`WA-IOT-EDGE-SDK `版本。 3. 测试设备为S7-300PLC ## 一、详细配件 1. S7-300 PLC CPU(CPU 314)×1 2. 220V AC电源线×1 3. 24V DC电源线×1 4. 220V AC转24V DC电源模块(PS307)×1 5. 数字量输出模块(SM322)×1 6. ETH-MPI/DP以太网转换器模块(Socket)×1 7. RJ45交叉网线×1 8. RS485转USB电缆×1 9. RS485公母线×1 ## 二、连线图 ![img](https://gitee.com/wasome/plugin_s7_plc/raw/master/doc/s7_300.png) 1. S7-300与网关网口方式连接网关 ![img](https://gitee.com/wasome/plugin_s7_plc/raw/master/doc/s7_300_conn.png) 2. ETH-MPI/DP模块设置 模块IP默认为[192.168.1.10](http://192.168.1.10/)(默认),port为258(默认),模块可以再IE上修改其IP地址、速率等属性,IE地址为[192.168.1.222](http://192.168.1.222/)。(百度搜索ETH-MPI/DP使用说明有具体使用方法)s7-300通过网口连接网关使用ISOTCP协议。 ## 三、接口 URL:/snap7?DI=[name]&Area=[AreaNumber]&Start=[StartNumber]&DBNumber=[DBNumber]&Datatype=[Datatype]&ITEMS=[items]&CovOrder=[bool] **字段说明:** | **字段** | **类型与有效值** | **必选** | **说明** | | -------- | ---------------- | --------- | -------------------------- | | DI | | 是 | 设备名称 | | ITEMS | 整形 | 否(缺省1) | 操作条目数, GET时有效 | | area | | 是 | PLC寄存器区域 | | DBNumber | | 是 | 区域编号,只有DB/V块时有值 | | Start | | 是 | 读写寄存器起始地址 | | DataType | | 是 | 数据读写类型 | | CovOrder | bool | 否(缺省0) | 是否转换字节序 | type: ``` [ "Bit", "Int8", "Uint8", "Int16", "Uint16", "Int32", "Uint32", "Int64", "Uint64", "Float", "Double" ] ``` area: ``` S7AreaPE S7AreaPA S7AreaMK S7AreaDB S7AreaCT S7AreaTM ``` ## 四、配置文件 定义格式如下: | **字段** | **类型与有效值** | **必选** | **说明** | | -------------- | ---------------- | -------- | ----------------- | | ip | 字符串 | 是 | 设备IP | | rack | 整形 | 是 | 机架号 | | slot | 整形 | 是 | 机架号 | | ConnectionType | 整形 | 是 | 连接方式,一般选1 |