diff --git a/APP_Framework/Applications/control_app/plc_demo/Makefile b/APP_Framework/Applications/control_app/plc_demo/Makefile index 3fba029fa..097c9f7d4 100755 --- a/APP_Framework/Applications/control_app/plc_demo/Makefile +++ b/APP_Framework/Applications/control_app/plc_demo/Makefile @@ -1,3 +1,3 @@ -SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence ab abb +SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence panasonic fatek ab abb include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Applications/control_app/plc_demo/br/image/Br PPC2100 PLC.jpg b/APP_Framework/Applications/control_app/plc_demo/br/image/Br PPC2100 PLC.jpg new file mode 100644 index 000000000..24d312116 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/br/image/Br PPC2100 PLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/br/test_recipe_br_ppc2100.json b/APP_Framework/Applications/control_app/plc_demo/br/json/test_recipe_br_ppc2100.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/br/test_recipe_br_ppc2100.json rename to APP_Framework/Applications/control_app/plc_demo/br/json/test_recipe_br_ppc2100.json diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/README.md b/APP_Framework/Applications/control_app/plc_demo/delta/README.md index 16ba6225c..6d0dec6b6 100644 --- a/APP_Framework/Applications/control_app/plc_demo/delta/README.md +++ b/APP_Framework/Applications/control_app/plc_demo/delta/README.md @@ -1,22 +1,48 @@ -# 台达 DVP通信测试 +# 台达 PLC与矽达通ARM通信测试 [TOC] -## 通信接线及参数设置 +## 台达DVP与矽达通ARM通信处测试 + +### 通信接线及参数设置 * 网口 * 通过自带 RJ45 网口连接 * 网口参数:IP:192.168.250.27 Port:502 * 测试的协议:Modbus TCP -## 存储区 +### 存储区 - 含M,D,X,Y。台达PLC中 各存储区地址和Modbus地址有明确的对应表,详见台达DVP协议解析测试文档。 -## 通信测试 +### 通信测试 - 共测试BOOL,INT16,INT32,FLOAT 共四种类型数据。 - 测试D区,M区和Y区。 +## 台达AS332T与矽达通ARM通信处测试 + +### 通信接线及参数设置 + +* 网口 + * 通过自带 RJ45 网口连接 + * 网口参数:IP:192.168.250.5 Port:502 + * 测试的协议:Modbus TCP + +### 存储区 + +- 含M,D,X,Y。台达PLC中 各存储区地址和Modbus地址有明确的对应表,详见台达AS332T协议解析测试文档。 + +### 通信测试结果 + +- 共测试BOOL,INT16,INT32,FLOAT 共四种类型数据。 +- 测试D区,M区和Y区。 + +![](./image/recipe.png) + +![](./image/test_result1.png) + +![](./image/test_result2.png) + diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/delta_as332t.c b/APP_Framework/Applications/control_app/plc_demo/delta/delta_as332t.c index 1b329319a..c60de8b64 100644 --- a/APP_Framework/Applications/control_app/plc_demo/delta/delta_as332t.c +++ b/APP_Framework/Applications/control_app/plc_demo/delta/delta_as332t.c @@ -1,4 +1,6 @@ /* + * Copyright (c) 2022 AIIT XUOS Lab + /* * Copyright (c) 2022 AIIT XUOS Lab * XiUOS is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. @@ -15,9 +17,53 @@ * @brief PLC DELTA AS332T app * @version 3.0 * @author AIIT XUOS Lab - * @date 2022.9.27 + * @date 2022.10.10 */ +#include + +extern int Adapter4GActive(void); + +void ControlDeltaas332tTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType modbus_tcp_protocol = ControlProtocolFind(); + if (NULL == modbus_tcp_protocol) { + printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol); + return; + } + + printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol); + + if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) { + ControlProtocolOpen(modbus_tcp_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(modbus_tcp_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlDeltaas332tTest, Delta as332t Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_as332t.jpg b/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_as332t.jpg new file mode 100644 index 000000000..a648395ad Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_as332t.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_dvp.jpg b/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_dvp.jpg new file mode 100644 index 000000000..c4d93ddf6 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/delta/image/delta_dvp.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/image/recipe.png b/APP_Framework/Applications/control_app/plc_demo/delta/image/recipe.png new file mode 100644 index 000000000..14fc4505e Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/delta/image/recipe.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result1.png b/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result1.png new file mode 100644 index 000000000..fc304c2dd Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result1.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result2.png b/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result2.png new file mode 100644 index 000000000..bdca3c1e6 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/delta/image/test_result2.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/json/test_recipe_delta_as332t_tcp.json b/APP_Framework/Applications/control_app/plc_demo/delta/json/test_recipe_delta_as332t_tcp.json new file mode 100644 index 000000000..8f80bf790 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/delta/json/test_recipe_delta_as332t_tcp.json @@ -0,0 +1,79 @@ +{ + "device_id": 1, + "device_name": "DELTA_AS332T_TCP", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.5", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.1", + "netmask": "255.255.254.0", + "port": 502 + }, + "protocol_type": 2, + "read_period": 1000, + "read_item_list": [ + { + "value_name": "M16", + "value_type": 1, + "function_code": 1, + "start_address": 16, + "quantity": 1 + }, + { + "value_name": "M17", + "value_type": 1, + "function_code": 1, + "start_address": 17, + "quantity": 1 + }, + { + "value_name": "M18", + "value_type": 1, + "function_code": 1, + "start_address": 30, + "quantity": 1 + }, + { + "value_name": "D300", + "value_type": 3, + "function_code": 3, + "start_address": 300, + "quantity": 1 + }, + { + "value_name": "D301", + "value_type": 3, + "function_code": 3, + "start_address": 302, + "quantity": 1 + }, + { + "value_name": "D302", + "value_type": 4, + "function_code": 3, + "start_address": 302, + "quantity": 2 + }, + { + "value_name": "D304", + "value_type": 9, + "function_code": 3, + "start_address": 304, + "quantity": 2 + }, + { + "value_name": "Y1.0", + "value_type": 1, + "function_code": 1, + "start_address": 40976, + "quantity": 1 + }, + { + "value_name": "Y10", + "value_type": 3, + "function_code": 3, + "start_address": 40970, + "quantity": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/delta/test_recipe_delta_dvp.json b/APP_Framework/Applications/control_app/plc_demo/delta/json/test_recipe_delta_dvp.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/delta/test_recipe_delta_dvp.json rename to APP_Framework/Applications/control_app/plc_demo/delta/json/test_recipe_delta_dvp.json diff --git a/APP_Framework/Applications/control_app/plc_demo/fatek/Makefile b/APP_Framework/Applications/control_app/plc_demo/fatek/Makefile new file mode 100644 index 000000000..f260dec57 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/fatek/Makefile @@ -0,0 +1,3 @@ +SRC_FILES := fatek_fbs_24mc_uart.c + +include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/fatek/Readme.md b/APP_Framework/Applications/control_app/plc_demo/fatek/Readme.md new file mode 100644 index 000000000..0e06ddcb9 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/fatek/Readme.md @@ -0,0 +1,42 @@ +# 永宏通信测试 + +[TOC] + +## 永宏FBs-24MCT2-AC通信测试 + +### 通信接线及参数设置 + +* 网口和串口 + * FBS-24MCT2自带圆口232,用于程序的下载。 + * 可本体拓展FBs-CBES用于Modbus TCP,永宏私有协议永宏协议等通信。板卡默认IP:192.168.2.3.端口号500,永宏协议 + * 通过本体拓展FBs-CM22通信模板,可用于Modbus RTU及永宏协议通信。串口接线:+接485A;-接485B。 + * 串口模块MODBUS RTU通信参数配置:通信速率:9600;数据位:8bit;停止位:1bit;校验:偶校验 + * 串口模块永宏协议通信参数配置:通信速率:9600;数据位:8bit;停止位:1bit;校验:偶校验 + * 终端与PLC通信测试,PC编程软件与PLC不能处于联机状态。 + + +### 存储区 + +- 存储区 X,Y,R,D区等。 + +### 通信测试 + +- 共测试BOOL,INT16等类型数据。 + + +- 测试Y区,R区及D区数据。 + + +- 测试截图: + + 测试PLC环境搭建: + + ![](./image/FATEK.jpg) + + 解析完成的配方为: + + ![](./image/panasonic_fpxh_recipe.png) + + 测试结果: + + ![](./image/panasonic_fpxh_communication_test.png) \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/fatek/fatek_fbs_24mc_uart.c b/APP_Framework/Applications/control_app/plc_demo/fatek/fatek_fbs_24mc_uart.c new file mode 100644 index 000000000..412044d4f --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/fatek/fatek_fbs_24mc_uart.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** + * @file fatek_fbs_24mc_uart.c + * @brief PLC fatek fbs app + * @version 3.0 + * @author AIIT XUOS Lab + * @date 2023.11.28 + */ + +#include + +extern int Adapter4GActive(void); + +void ControlFatekFBsUartTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType modbus_rtu_protocol = ControlProtocolFind(); + if (NULL == modbus_rtu_protocol) { + printf("%s get modbus rtu protocol %p failed\n", __func__, modbus_rtu_protocol); + return; + } + + printf("%s get modbus rtu protocol %p successfull\n", __func__, modbus_rtu_protocol); + + if (CONTROL_REGISTERED == modbus_rtu_protocol->protocol_status) { + ControlProtocolOpen(modbus_rtu_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(modbus_rtu_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] modbus rtu data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(modbus_rtu_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlFatekFBsUartTest, fatek fbs uart Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/fatek/image/FATEK.jpg b/APP_Framework/Applications/control_app/plc_demo/fatek/image/FATEK.jpg new file mode 100644 index 000000000..a201d9a6e Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/fatek/image/FATEK.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/fatek/json/test_recipe_fatek_fbs24mc_uart.json b/APP_Framework/Applications/control_app/plc_demo/fatek/json/test_recipe_fatek_fbs24mc_uart.json new file mode 100644 index 000000000..b01773890 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/fatek/json/test_recipe_fatek_fbs24mc_uart.json @@ -0,0 +1,37 @@ +{ + "device_id": 1, + "device_name": "FATEK_FBSMC24T_RTU", + "communication_type": 1, + "serial_config": { + "station": 1, + "baud_rate": 9600, + "data_bits": 8, + "stop_bits": 1, + "check_mode":3 + }, + "protocol_type": 3, + "read_period": 2000, + "read_item_list": [ + { + "value_name": "Y0", + "value_type": 1, + "function_code": 1, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "D0", + "value_type": 3, + "function_code": 3, + "start_address": 6000, + "quantity": 1 + }, + { + "value_name": "R10", + "value_type": 3, + "function_code": 3, + "start_address": 10, + "quantity": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/ge/img/GE CPE100.jpg b/APP_Framework/Applications/control_app/plc_demo/ge/img/GE CPE100.jpg new file mode 100644 index 000000000..52b954f82 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/ge/img/GE CPE100.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/ge/img/GE versamax CPU001.jpg b/APP_Framework/Applications/control_app/plc_demo/ge/img/GE versamax CPU001.jpg new file mode 100644 index 000000000..0ffd18130 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/ge/img/GE versamax CPU001.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/ge/test_recipe_ge_cpe_tcp.json b/APP_Framework/Applications/control_app/plc_demo/ge/json/test_recipe_ge_cpe_tcp.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/ge/test_recipe_ge_cpe_tcp.json rename to APP_Framework/Applications/control_app/plc_demo/ge/json/test_recipe_ge_cpe_tcp.json diff --git a/APP_Framework/Applications/control_app/plc_demo/ge/test_recipe_ge_versamax_rtu.json b/APP_Framework/Applications/control_app/plc_demo/ge/json/test_recipe_ge_versamax_rtu.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/ge/test_recipe_ge_versamax_rtu.json rename to APP_Framework/Applications/control_app/plc_demo/ge/json/test_recipe_ge_versamax_rtu.json diff --git a/APP_Framework/Applications/control_app/plc_demo/inovance/image/inovance_1608TN.jpg b/APP_Framework/Applications/control_app/plc_demo/inovance/image/inovance_1608TN.jpg new file mode 100644 index 000000000..a541548d9 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/inovance/image/inovance_1608TN.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/inovance/test_recipe_inovance_am401_tcp.json b/APP_Framework/Applications/control_app/plc_demo/inovance/json/test_recipe_inovance_am401_tcp.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/inovance/test_recipe_inovance_am401_tcp.json rename to APP_Framework/Applications/control_app/plc_demo/inovance/json/test_recipe_inovance_am401_tcp.json diff --git a/APP_Framework/Applications/control_app/plc_demo/inovance/test_recipe_inovance_am401_uart.json b/APP_Framework/Applications/control_app/plc_demo/inovance/json/test_recipe_inovance_am401_uart.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/inovance/test_recipe_inovance_am401_uart.json rename to APP_Framework/Applications/control_app/plc_demo/inovance/json/test_recipe_inovance_am401_uart.json diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/Makefile b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/Makefile index 72090f4f1..845e91dc0 100755 --- a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/Makefile +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/Makefile @@ -1,3 +1,3 @@ -SRC_FILES := mitsubishi_fx3u.c mitsubishi_fx5u.c mitsubishi_fx2n.c mitsubishi_q02u.c +SRC_FILES := mitsubishi_fx3u.c mitsubishi_fx5u.c mitsubishi_fx2n.c mitsubishi_q02u.c mitsubishi_q06h.c mitsubishi_q03udv.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/README.md b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/README.md index a5fa32bb6..7fd213d9b 100644 --- a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/README.md +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/README.md @@ -1,24 +1,88 @@ -# 三菱 FX2N通信测试 +# 三菱通信测试 [TOC] -## 通信接线及参数设置 +## 三菱FX2N通信测试 + +### 通信接线及参数设置 * 串口 * FX2N自带8针圆口422,用于程序的下载。全系列不支持网口,且需购买串口拓展模块FX2N-485-BD用于通信测试。 * 接线:RDA和SDA短接,引出A;RDB与SDB短接,引出B。 * 串口模块支持MC-1C协议,通信速率:9600;数据位:7bit;停止位:1bit;校验:偶校验 -## 存储区 +### 存储区 - 存储区 I,Q,M,D区。 -## 通信测试 +### 通信测试 - 共测试BOOL,INT16,FLOAT共三种类型数据。 - 测试M区及D区数据。 +## 三菱Q06H通信测试 + +### 通信接线及参数设置 + +* 接口 + * 首次连接时,可通过CPU自带的串口(打印机方口线)进行程序的下载。 + * 本次测试通过Q06H拓展的模块QJ71E71_100模块的网口模块进行MC—3E通信测试。 + * PLC网口模块IP:192.168.250.21 端口号:4000 + +### 存储区 + +- 存储区 I,Q,M,D区。 + +### 通信测试 + +- 共测试BOOL,INT16,FLOAT共三种类型数据。 +- 测试M区及D区数据。 + +- 测试截图: + + 解析完成的配方为 + + ![](./image/q06h_recipe.png) + + 测试结果: + + ![](./image/q06h_communication_test.png) + + + +## 三菱Q03UDV通信测试 + +### 通信接线及参数设置 + +* 接口 + * 本次测试通过Q03UDV拓展的模块QJ71E71_100模块的网口模块进行MC—3E通信测试。网口模块IP:192.168.250.21 端口号:4000 + * 本次测试还可通过Q03UDV自身网口进行MC—3E通信测试。网口模块IP:192.168.250.22 端口号:6000 + +### 存储区 + +- 存储区 I,Q,M,D区。 + +### 通信测试 + +- 共测试BOOL,INT16,FLOAT共三种类型数据。 + + +- 测试M区及D区数据。 + +- 测试截图: + + 扩展模块解析完成的配方为 + + ![](./image/q03udv_recipe.png) + + CPU自带网口解析完成的配方为 + + ![](image/Q03udv_recipe_1.png) + + 测试结果: + + ![](./image/q03udv_communication_test.png) diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/FX2NPLC.jpg b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/FX2NPLC.jpg new file mode 100644 index 000000000..f7cc1e5f1 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/FX2NPLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Fx3UPLC.jpg b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Fx3UPLC.jpg new file mode 100644 index 000000000..adcd82cf3 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Fx3UPLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q02UPLC.jpg b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q02UPLC.jpg new file mode 100644 index 000000000..1ea129440 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q02UPLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udvPLC.jpg b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udvPLC.jpg new file mode 100644 index 000000000..757b8c004 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udvPLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udv_recipe_1.png b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udv_recipe_1.png new file mode 100644 index 000000000..4087d421f Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q03udv_recipe_1.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q06HPLC.jpg b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q06HPLC.jpg new file mode 100644 index 000000000..e86a13c74 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/Q06HPLC.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_communication_test.png b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_communication_test.png new file mode 100644 index 000000000..e32d3ed89 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_communication_test.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_recipe.png b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_recipe.png new file mode 100644 index 000000000..341ed3972 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q03udv_recipe.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_communication_test.png b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_communication_test.png new file mode 100644 index 000000000..380205847 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_communication_test.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_recipe.png b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_recipe.png new file mode 100644 index 000000000..970a4c41d Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/image/q06h_recipe.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/test_recipe_mc_1c.json b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_1c.json similarity index 100% rename from APP_Framework/Applications/control_app/plc_demo/mitsubishi/test_recipe_mc_1c.json rename to APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_1c.json diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_1e.json b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_1e.json new file mode 100644 index 000000000..d44caa6b6 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_1e.json @@ -0,0 +1,368 @@ +{ + "device_id": 1, + "device_name": "FX3U_MC_1E", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.25", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.1", + "netmask": "255.255.254.0", + "port": 2000 + }, + "protocol_type": 6, + "read_period": 2000, + "read_item_list": [ + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֹͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ʹ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "6", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "20", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "21", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "22", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֶģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "23", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "24", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "з", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "25", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "26", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "27", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "5", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "6", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "50", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "7", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "51", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "8", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "52", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "9", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "53", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "200", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "202", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "204", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ʼλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "206", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "յλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "208", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ֵ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "300", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "302", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "304", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "306", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "308", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "Y001", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Y002", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Y010", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "10", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "D400", + "value_type": 4, + "device_code": "D", + "head_device_number_string": "400", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + } + + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3c.json b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3c.json new file mode 100644 index 000000000..185fc7708 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3c.json @@ -0,0 +1,331 @@ +{ + "device_id": 769, + "device_name": "Q02UCPU", + "communication_type": 1, + "serial_config": { + "station": 0, + "baud_rate": 19200, + "data_bits": 7, + "stop_bits": 1, + "check_mode": 3 + }, + "protocol_type": 10, + "read_period": 1000, + "read_item_list": [ + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֹͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ʹ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "6", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "20", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "21", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "22", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֶģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "23", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "24", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "з", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "25", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "26", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "27", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "5", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "6", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "50", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "7", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "51", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "8", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "52", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "9", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "53", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "200", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "202", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "204", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ʼλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "206", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "յλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "208", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ֵ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "300", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "302", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "304", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "306", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "308", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3e.json b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3e.json new file mode 100644 index 000000000..6c99230a4 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/json/test_recipe_mc_3e.json @@ -0,0 +1,494 @@ +{ + "device_id": 1, + "device_name": "Q02UCPU_MC_3E", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.21", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.1", + "netmask": "255.255.254.0", + "port": 4000 + }, + "protocol_type": 7, + "read_period": 2000, + "read_item_list": [ + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֹͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ʹ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ͣ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "6", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "20", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "21", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "22", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "ֶģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "23", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Զģʽ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "24", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "з", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "25", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "λ", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "26", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 1, + "device_code": "M", + "head_device_number_string": "27", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "0", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "3", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "4", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "5", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "5", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "6", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "50", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "7", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "51", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "8", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "52", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "9", + "value_type": 3, + "device_code": "D", + "head_device_number_string": "53", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "200", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "202", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ٶ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "204", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ʼλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "206", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "յλ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "208", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "ֵ", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "300", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "1", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "302", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "2", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "304", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "3", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "306", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "4", + "value_type": 9, + "device_code": "D", + "head_device_number_string": "308", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "Y001", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Y002", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "2", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "Y010", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "10", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "D400", + "value_type": 4, + "device_code": "D", + "head_device_number_string": "400", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "D402", + "value_type": 8, + "device_code": "D", + "head_device_number_string": "402", + "device_points_count": 4, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "D406", + "value_type": 8, + "device_code": "D", + "head_device_number_string": "406", + "device_points_count": 4, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "B1", + "value_type": 1, + "device_code": "B", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "B10", + "value_type": 1, + "device_code": "B", + "head_device_number_string": "10", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "B20", + "value_type": 1, + "device_code": "B", + "head_device_number_string": "20", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 100 + }, + { + "value_name": "W1", + "value_type": 3, + "device_code": "W", + "head_device_number_string": "1", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "W2", + "value_type": 4, + "device_code": "W", + "head_device_number_string": "2", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "W4", + "value_type": 9, + "device_code": "W", + "head_device_number_string": "4", + "device_points_count": 2, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "W6", + "value_type": 8, + "device_code": "W", + "head_device_number_string": "6", + "device_points_count": 4, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "W22", + "value_type": 3, + "device_code": "W", + "head_device_number_string": "22", + "device_points_count": 1, + "command_type": 1, + "monitoring_timer": 100 + }, + { + "value_name": "B44", + "value_type": 1, + "device_code": "B", + "head_device_number_string": "44", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 500 + }, + { + "value_name": "B200", + "value_type": 1, + "device_code": "B", + "head_device_number_string": "200", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 500 + }, + { + "value_name": "Y100", + "value_type": 1, + "device_code": "Y", + "head_device_number_string": "100", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 500 + }, + { + "value_name": "X150", + "value_type": 1, + "device_code": "X", + "head_device_number_string": "150", + "device_points_count": 1, + "command_type": 0, + "monitoring_timer": 500 + } + + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q03udv.c b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q03udv.c new file mode 100644 index 000000000..9c374c946 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q03udv.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** + * @file mitsubishi_q03udv.c + * @brief PLC MITSUBISHI Q03udv app + * @version 3.0 + * @author AIIT XUOS Lab + * @date 2023.10.30 + */ + +#include + +extern int Adapter4GActive(void); + +void ControlQ03udvTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType melsec_3e_protocol = ControlProtocolFind(); + if (NULL == melsec_3e_protocol) { + printf("%s get melsec 3e protocol %p failed\n", __func__, melsec_3e_protocol); + return; + } + + printf("%s get melsec 3e protocol %p successfull\n", __func__, melsec_3e_protocol); + + if (CONTROL_REGISTERED == melsec_3e_protocol->protocol_status) { + ControlProtocolOpen(melsec_3e_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(melsec_3e_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] melsec 3c data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(melsec_3c_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlQ03udvTest, Mitsubishi Q03udv Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q06h.c b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q06h.c new file mode 100644 index 000000000..a65e26722 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/mitsubishi/mitsubishi_q06h.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** + * @file mitsubishi_q06h.c + * @brief PLC MITSUBISHI Q06H app + * @version 3.0 + * @author AIIT XUOS Lab + * @date 2023.10.30 + */ + +#include + +extern int Adapter4GActive(void); + +void ControlQ06hTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType melsec_3e_protocol = ControlProtocolFind(); + if (NULL == melsec_3e_protocol) { + printf("%s get melsec 3e protocol %p failed\n", __func__, melsec_3e_protocol); + return; + } + + printf("%s get melsec 3e protocol %p successfull\n", __func__, melsec_3e_protocol); + + if (CONTROL_REGISTERED == melsec_3e_protocol->protocol_status) { + ControlProtocolOpen(melsec_3e_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(melsec_3e_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] melsec 3c data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(melsec_3c_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlQ06hTest, Mitsubishi Q06H Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/omron/json/test_recipe_nj501_fins.json b/APP_Framework/Applications/control_app/plc_demo/omron/json/test_recipe_nj501_fins.json new file mode 100644 index 000000000..28c128e42 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/omron/json/test_recipe_nj501_fins.json @@ -0,0 +1,26 @@ +{ + "device_id": 1, + "device_name": "NJ501", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.22", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.1", + "netmask": "255.255.255.0", + "port": 9600 + }, + "protocol_type": 5, + "read_period": 100, + "read_item_list": [ + + { + "value_name": "整型1", + "value_type": 3, + "area_char": "D", + "data_type": 1, + "start_address": 100, + "bit_address": 0, + "data_length": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/omron/omron_nj501.c b/APP_Framework/Applications/control_app/plc_demo/omron/omron_nj501.c index d265aa953..cc57e6961 100644 --- a/APP_Framework/Applications/control_app/plc_demo/omron/omron_nj501.c +++ b/APP_Framework/Applications/control_app/plc_demo/omron/omron_nj501.c @@ -18,6 +18,34 @@ * @date 2022.9.27 */ - +#include + +void ControlNj501Test(void) +{ + int i = 0; + uint16_t read_data_length = 0; + uint8_t read_data[1024] = {0}; + ControlProtocolType fins_protocol = ControlProtocolFind(); + if (NULL == fins_protocol) { + printf("%s get fins protocol %p failed\n", __func__, fins_protocol); + return; + } + + printf("%s get fins protocol %p successfull\n", __func__, fins_protocol); + + if (CONTROL_REGISTERED == fins_protocol->protocol_status) { + ControlProtocolOpen(fins_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(fins_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] fins data %d using receipe file\n", __func__, i, read_data_length); + i++; + PrivTaskDelay(100000); + } + + //ControlProtocolClose(fins_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlNj501Test, Omron Plc FINS Demo, PRIV_SHELL_CMD_MAIN_ATTR); diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/Makefile b/APP_Framework/Applications/control_app/plc_demo/panasonic/Makefile new file mode 100644 index 000000000..796e6874a --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/Makefile @@ -0,0 +1,3 @@ +SRC_FILES := panasonic_fpxh_tcp.c panasonic_fpxh_uart.c + +include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/Readme.md b/APP_Framework/Applications/control_app/plc_demo/panasonic/Readme.md new file mode 100644 index 000000000..c27a7ed43 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/Readme.md @@ -0,0 +1,39 @@ +# 松下通信测试 + +[TOC] + +## 松下FPXHC40ET通信测试 + +### 通信接线及参数设置 + +* 网口和串口 + * FPXHC40ET自带miniUSB,用于程序的下载。本体自带的串口为RS232。 + * 本体自带的网口可用于Modbus TCP,Ethernet/IP等通信。目前用于Modbus TCP通信测试,网口IP:192.168.250.51 Port:502 + * 通过本体拓展FPXH-COM3通信模板,可用于Modbus RTU通信。串口接线:S+接485A;S-接485B。 + * 串口模块通信参数配置:通信速率:115200;数据位:8bit;停止位:1bit;校验:偶校验 + +### 存储区 + +- 存储区 X,Y,R,D,L区等。 + +### 通信测试 + +- 共测试BOOL,INT16等类型数据。 + + +- 测试Y区,R区及DT区数据。 + + +- 测试截图: + + 测试PLC环境搭建: + + ![](./image/PLC_xidatong.jpg) + + 解析完成的配方为: + + ![](./image/panasonic_fpxh_recipe.png) + + 测试结果: + + ![](./image/panasonic_fpxh_communication_test.png) \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/image/PLC_xidatong.jpg b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/PLC_xidatong.jpg new file mode 100644 index 000000000..703290392 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/PLC_xidatong.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic-fpxh.jpg b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic-fpxh.jpg new file mode 100644 index 000000000..5bf2b9103 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic-fpxh.jpg differ diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_communication_test.png b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_communication_test.png new file mode 100644 index 000000000..c3765e56b Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_communication_test.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_recipe.png b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_recipe.png new file mode 100644 index 000000000..3f0c45778 Binary files /dev/null and b/APP_Framework/Applications/control_app/plc_demo/panasonic/image/panasonic_fpxh_recipe.png differ diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json new file mode 100644 index 000000000..3ee81bdea --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json @@ -0,0 +1,65 @@ +{ + "device_id": 1, + "device_name": "PANASONIC_FPXH_TCP", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.51", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.1", + "netmask": "255.255.254.0", + "port": 502 + }, + "protocol_type": 2, + "read_period": 1000, + "read_item_list": [ + { + "value_name": "Y0", + "value_type": 1, + "function_code": 1, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "R0", + "value_type": 1, + "function_code": 1, + "start_address":2048, + "quantity": 1 + }, + { + "value_name": "R100", + "value_type": 1, + "function_code": 1, + "start_address": 2208, + "quantity": 1 + }, + { + "value_name": "R101", + "value_type": 1, + "function_code": 1, + "start_address": 2209, + "quantity": 1 + }, + { + "value_name": "DT0", + "value_type": 3, + "function_code": 3, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "DT1", + "value_type": 3, + "function_code": 3, + "start_address": 1, + "quantity": 1 + }, + { + "value_name": "DT200", + "value_type": 3, + "function_code": 3, + "start_address": 200, + "quantity": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json new file mode 100644 index 000000000..13d81a7b7 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json @@ -0,0 +1,66 @@ +{ + "device_id": 1, + "device_name": "PANASONIC_FPXH_RTU", + "communication_type": 1, + "serial_config": { + "station": 1, + "baud_rate": 9600, + "data_bits": 8, + "stop_bits": 1, + "check_mode":3 + }, + "protocol_type": 3, + "read_period": 2000, + "read_item_list": [ + { + "value_name": "Y0", + "value_type": 1, + "function_code": 1, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "R0", + "value_type": 1, + "function_code": 1, + "start_address":2048, + "quantity": 1 + }, + { + "value_name": "R100", + "value_type": 1, + "function_code": 1, + "start_address": 2208, + "quantity": 1 + }, + { + "value_name": "R101", + "value_type": 1, + "function_code": 1, + "start_address": 2209, + "quantity": 1 + }, + { + "value_name": "DT0", + "value_type": 3, + "function_code": 3, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "DT1", + "value_type": 3, + "function_code": 3, + "start_address": 1, + "quantity": 1 + }, + { + "value_name": "DT200", + "value_type": 3, + "function_code": 3, + "start_address": 200, + "quantity": 1 + } + + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_tcp.c b/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_tcp.c new file mode 100644 index 000000000..cbd779c02 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_tcp.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** + * @file panasonic_fpxh_ethernet.c + * @brief PLC panasonic fpxh app + * @version 3.0 + * @author AIIT XUOS Lab + * @date 2023.11.22 + */ + +#include + +extern int Adapter4GActive(void); + +void ControlPanasonicFpxhTCPTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType modbus_tcp_protocol = ControlProtocolFind(); + if (NULL == modbus_tcp_protocol) { + printf("%s get modbus tcp protocol %p failed\n", __func__, modbus_tcp_protocol); + return; + } + + printf("%s get modbus tcp protocol %p successfull\n", __func__, modbus_tcp_protocol); + + if (CONTROL_REGISTERED == modbus_tcp_protocol->protocol_status) { + ControlProtocolOpen(modbus_tcp_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(modbus_tcp_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] modbus tcp data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(modbus_tcp_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlPanasonicFpxhTCPTest, panasonic Fpxh TCP Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_uart.c b/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_uart.c new file mode 100644 index 000000000..8f75ec9a0 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/panasonic_fpxh_uart.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2022 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +/** + * @file panasonic_fpxh_uart.c + * @brief PLC panasonic fpxh app + * @version 3.0 + * @author AIIT XUOS Lab + * @date 2023.11.22 + */ + +#include + +extern int Adapter4GActive(void); + +void ControlPanasonicFpxhUartTest(void) +{ + int i, j = 0; + int read_data_length = 0; + uint8_t read_data[128] = {0}; + +#ifdef CONNECTION_ADAPTER_4G + Adapter4GActive(); +#endif + + ControlProtocolType modbus_rtu_protocol = ControlProtocolFind(); + if (NULL == modbus_rtu_protocol) { + printf("%s get modbus rtu protocol %p failed\n", __func__, modbus_rtu_protocol); + return; + } + + printf("%s get modbus rtu protocol %p successfull\n", __func__, modbus_rtu_protocol); + + if (CONTROL_REGISTERED == modbus_rtu_protocol->protocol_status) { + ControlProtocolOpen(modbus_rtu_protocol); + + for (;;) { + read_data_length = ControlProtocolRead(modbus_rtu_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] modbus rtu data %d using receipe file\n", __func__, i, read_data_length); + if (read_data_length) { + for (j = 0; j < read_data_length; j ++) { + printf("j %d data 0x%x\n", j, read_data[j]); + } + } + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + + //ControlProtocolClose(modbus_rtu_protocol); + } +} +PRIV_SHELL_CMD_FUNCTION(ControlPanasonicFpxhUartTest, panasonic fpxh uart Demo, PRIV_SHELL_CMD_MAIN_ATTR); + + diff --git a/APP_Framework/Applications/control_app/plc_demo/siemens/Makefile b/APP_Framework/Applications/control_app/plc_demo/siemens/Makefile index 54fb32baa..815382667 100755 --- a/APP_Framework/Applications/control_app/plc_demo/siemens/Makefile +++ b/APP_Framework/Applications/control_app/plc_demo/siemens/Makefile @@ -1,3 +1,3 @@ -SRC_FILES := siemens_s7_200_cn.c siemens_s7_200_smart.c siemens_s7_300.c siemens_s7_1200.c siemens_s7_1500.c +SRC_FILES := siemens_s7_200_cn.c siemens_s7_200_smart.c siemens_s7_1200.c siemens_s7_1500.c include $(KERNEL_ROOT)/compiler.mk diff --git a/APP_Framework/Applications/control_app/plc_demo/siemens/json/test_recipe_simens_s71200.json b/APP_Framework/Applications/control_app/plc_demo/siemens/json/test_recipe_simens_s71200.json new file mode 100644 index 000000000..408eff339 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/siemens/json/test_recipe_simens_s71200.json @@ -0,0 +1,25 @@ +{ + "device_id": 1, + "device_name": "S7-1215", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.5", + "local_ip": "192.168.250.233", + "gateway": "192.168.250.252", + "netmask": "255.255.255.0", + "port": 102 + }, + "protocol_type": 1, + "read_period": 100, + "read_item_list": [ + { + "value_name": "浮点数", + "value_type": 9, + "area": "DB", + "wordlen": "Real", + "db_number": 10, + "start": 32, + "amount": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_1200.c b/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_1200.c index 9cbbeae1a..f2a35f4cf 100644 --- a/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_1200.c +++ b/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_1200.c @@ -18,3 +18,28 @@ * @date 2023.3.27 */ +#include +void ControlS71200Test(void) +{ + int i = 0; + uint16_t read_data_length = 0; + uint8_t read_data[1024] = {0}; + ControlProtocolType s7_protocol = ControlProtocolFind(); + if (NULL == s7_protocol) { + printf("%s get s7 protocol %p failed\n", __func__, s7_protocol); + return; + } + printf("%s get s7 protocol %p successfull\n", __func__, s7_protocol); + if (CONTROL_REGISTERED == s7_protocol->protocol_status) { + ControlProtocolOpen(s7_protocol); + for (;;) { + read_data_length = ControlProtocolRead(s7_protocol, read_data, sizeof(read_data)); + printf("%s read [%d] s7 data %d using receipe file\n", __func__, i, read_data_length); + i++; + memset(read_data, 0, sizeof(read_data)); + PrivTaskDelay(10000); + } + } +} + +PRIV_SHELL_CMD_FUNCTION(ControlS71200Test, Siemens Plc S7_1215 Demo, PRIV_SHELL_CMD_MAIN_ATTR); \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_300.c b/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_300.c deleted file mode 100644 index 88d09209e..000000000 --- a/APP_Framework/Applications/control_app/plc_demo/siemens/siemens_s7_300.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 AIIT XUOS Lab - * XiUOS is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. - * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - */ - -/** - * @file siemens_s7_300.c - * @brief PLC SIEMENS S7-300 app - * @version 3.0 - * @author AIIT XUOS Lab - * @date 2023.3.27 - */ - diff --git a/Ubiquitous/XiZi_IIoT/board/edu-arm32/third_party_driver/can/connect_can.c b/Ubiquitous/XiZi_IIoT/board/edu-arm32/third_party_driver/can/connect_can.c index df7842f50..0414fd3ee 100644 --- a/Ubiquitous/XiZi_IIoT/board/edu-arm32/third_party_driver/can/connect_can.c +++ b/Ubiquitous/XiZi_IIoT/board/edu-arm32/third_party_driver/can/connect_can.c @@ -182,7 +182,7 @@ static uint32 CanReadData(void *dev , struct BusBlockReadParam *databuf) ret = CAN_GetRxFrame(CAN_X, &frame_received); if(EOK != ret){ - // KPrintf("CAN recv frame failed(CODE:%d)!\n",ret); + // KPrintf("CAN recv frame failed(CODE:%d)!\n",ret); p_can_config->data_lenth = 0; return ERROR; }