1.add panasonic fpxh plc test app 2.add panasonic fpxh plc readme file

This commit is contained in:
jqy1988 2023-11-24 10:23:24 +08:00
parent 81924837dd
commit e5e654988b
10 changed files with 171 additions and 5 deletions

View File

@ -1,3 +1,3 @@
SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence panasonic
include $(KERNEL_ROOT)/compiler.mk include $(KERNEL_ROOT)/compiler.mk

View File

@ -0,0 +1,3 @@
SRC_FILES := panasonic_fpxh_tcp.c panasonic_fpxh_uart.c
include $(KERNEL_ROOT)/compiler.mk

View File

@ -0,0 +1,39 @@
# 松下通信测试
[TOC]
## 松下FPXHC40ET通信测试
### 通信接线及参数设置
* 网口和串口
* FPXHC40ET自带miniUSB用于程序的下载。本体自带的串口为RS232。
* 本体自带的网口可用于Modbus TCPEthernet/IP等通信。目前用于Modbus TCP通信测试网口IP192.168.250.51 Port502
* 通过本体拓展FPXH-COM3通信模板可用于Modbus RTU通信。串口接线S+接485AS-接485B。
* 串口模块通信参数配置通信速率115200数据位8bit停止位1bit校验偶校验
### 存储区
- 存储区 XYRDL区等。
### 通信测试
- 共测试BOOLINT16等类型数据。
- 测试Y区R区及DT区数据。
- 测试截图:
测试PLC环境搭建
![](./image/PLC_xidatong.jpg)
解析完成的配方为:
![](./image/panasonic_fpxh_recipe.png)
测试结果:
![](./image/panasonic_fpxh_communication_test.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -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 <control.h>
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);

View File

@ -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 <control.h>
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);

View File

@ -412,11 +412,7 @@ The STM32F4x7 allows computing and verifying the IP, UDP, TCP and ICMP checksums
- To use this feature let the following define uncommented. - To use this feature let the following define uncommented.
- To disable it and process by CPU comment the the checksum. - To disable it and process by CPU comment the the checksum.
*/ */
<<<<<<< HEAD
#define CHECKSUM_BY_HARDWARE #define CHECKSUM_BY_HARDWARE
=======
#define CHECKSUM_BY_HARDWARE
>>>>>>> f27c6d2091fa87777963810d926380f3ab178dab
#ifdef CHECKSUM_BY_HARDWARE #ifdef CHECKSUM_BY_HARDWARE
/* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/ /* CHECKSUM_GEN_IP==0: Generate checksums by hardware for outgoing IP packets.*/