forked from xuos/xiuos
add delta as332t plc test app and modify readme file
This commit is contained in:
parent
9a210fa9db
commit
46a15c1dc7
|
@ -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区。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
|
|
@ -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 <control.h>
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 123 KiB |
Binary file not shown.
After Width: | Height: | Size: 171 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue