forked from xuos/xiuos
1.add melsec Q03udv test app 2.modify readme file
This commit is contained in:
parent
5af6d63cd4
commit
ef4e4b37c0
|
@ -1,3 +1,3 @@
|
|||
SRC_FILES := mitsubishi_fx3u.c mitsubishi_fx5u.c mitsubishi_fx2n.c mitsubishi_q02u.c mitsubishi_q06h.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
|
||||
|
|
|
@ -51,3 +51,38 @@
|
|||
测试结果:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 三菱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区数据。
|
||||
|
||||
- 测试截图:
|
||||
|
||||
扩展模块解析完成的配方为
|
||||
|
||||

|
||||
|
||||
CPU自带网口解析完成的配方为
|
||||
|
||||

|
||||
|
||||
测试结果:
|
||||
|
||||

|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 164 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
|
@ -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 <control.h>
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue