forked from xuos/xiuos
Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into lorawan_develop
This commit is contained in:
commit
20037285c0
|
@ -1,4 +1,4 @@
|
||||||
# KEYENCE 通信测试
|
# keyence通信测试
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
|
@ -12,11 +12,55 @@
|
||||||
|
|
||||||
- 存储区ZF区。
|
- 存储区ZF区。
|
||||||
|
|
||||||
|
## JSON配方设计
|
||||||
|
|
||||||
|
* 共测试INT16共1种类型数据,以下为JSON文件解释。
|
||||||
|
|
||||||
|
- ```json
|
||||||
|
{
|
||||||
|
"device_id": 1, //设备ID默认是1,此参数无效
|
||||||
|
"device_name": "KV8000", //设备名称,自定义
|
||||||
|
"communication_type": 0, //通讯协议类型 0是以太网,1是串口
|
||||||
|
"socket_config": { //以太网配置
|
||||||
|
"plc_ip": "192.168.250.40", //PLC的IP地址
|
||||||
|
"local_ip": "192.168.250.233", //矽达通IP地址设定
|
||||||
|
"gateway": "192.168.250.1", //矽达通的网关地址设定
|
||||||
|
"netmask": "255.255.255.0", //矽达通子网掩码设定
|
||||||
|
"port":502 //端口号设定
|
||||||
|
},
|
||||||
|
"protocol_type": 3, //通讯协议,3代表modbus-tcp协议
|
||||||
|
"read_period": 100, //交互周期ms
|
||||||
|
"read_item_list": [
|
||||||
|
{
|
||||||
|
"value_name": "ZF0", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3是读
|
||||||
|
"start_address": 0, //起始地址
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value_name": "ZF2", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3/6是读
|
||||||
|
"start_address": 2, //起始地址偏移1位
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 通信测试
|
## 通信测试
|
||||||
|
|
||||||
(1)共测试INT16类型数据。
|
(1) 新增1个通信demo,命名为keyence_KV8000.c;
|
||||||
|
|
||||||
(2)测试ZF区数据。
|
(2) 复制样例代码程序到keyence_KV8000.c文件中;
|
||||||
|
|
||||||
(3)D区数据测试,用功能码03和06,以字为单位读写。如读写ZF1,则配方文件中起始地址则直接写1即可。
|
(3) void **ControlKV8000Test**(void) 更改函数名;
|
||||||
|
|
||||||
|
(4) PRIV_SHELL_CMD_FUNCTION(**ControKV8000Test**, keyence plc KV8000 Demo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
|
||||||
|
|
||||||
|
(5) 剪裁配置完成后,用过烧写器下载至矽达通中,重启后完成测试。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
# OMRON_CP1L通信测试
|
# OMRON_CP1L/H通信测试
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
## 通信接线及参数设置
|
## 通信接线及参数设置
|
||||||
|
|
||||||
* 本体无接口,增加CP1W-CIF41网络板卡
|
* CP1L本体无接口,增加CP1W-CIF41网络板卡,CP1H自带网口,采用网线直连的方式
|
||||||
|
|
||||||
* FINS协议,PLC IP:192.168.250.31,Port:9600
|
* FINS协议,PLC IP:192.168.250.31,Port:9600
|
||||||
|
* 
|
||||||
|
* 
|
||||||
|
* 
|
||||||
|
|
||||||
## 存储区
|
## 存储区
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 190 KiB |
Binary file not shown.
After Width: | Height: | Size: 182 KiB |
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
54
APP_Framework/Applications/control_app/plc_demo/schneider/README.md
Normal file → Executable file
54
APP_Framework/Applications/control_app/plc_demo/schneider/README.md
Normal file → Executable file
|
@ -1,21 +1,65 @@
|
||||||
# SCHNEIDER M241通信测试
|
# SCHNEIDER M241L通信测试
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
## 通信接线及参数设置
|
## 通信接线及参数设置
|
||||||
|
|
||||||
* 串口
|
* 串口
|
||||||
* M241支持2路485串口,本次采用的是serial2。波特率:9600,数据位:8位,停止位:1位,校验:偶校验
|
* M241支持2路485串口,本次采用的是serial2。波特率:9600,数据位:8位,停止位:1位,校验:偶校验
|
||||||
|
|
||||||
## 存储区
|
## 存储区
|
||||||
|
|
||||||
- 存储区MW区。
|
- 存储区MW区。
|
||||||
|
|
||||||
|
## JSON配方设计
|
||||||
|
|
||||||
|
* 共测试BOOL,INT16共2种类型数据,以下为JSON文件解释。
|
||||||
|
|
||||||
|
- ```json
|
||||||
|
{
|
||||||
|
"device_id": 1, //设备ID默认是1,此参数无效
|
||||||
|
"device_name": "m241", //设备名称,自定义
|
||||||
|
"communication_type": 1, //通讯协议类型 0是以太网,1是串口
|
||||||
|
"serial_config": { //串口配置
|
||||||
|
"station": 1, //站号
|
||||||
|
"baud_rate": 9600, //波特率
|
||||||
|
"data_bits": 8, //数据位
|
||||||
|
"stop_bits": 1, //停止位
|
||||||
|
"check_mode": 3 //1无校验,2校验,3偶校验
|
||||||
|
},
|
||||||
|
"protocol_type": 3, //通讯协议,3代表modbus-tcp协议
|
||||||
|
"read_period": 100, //交互周期ms
|
||||||
|
"read_item_list": [
|
||||||
|
{
|
||||||
|
"value_name": "MW0", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3是读
|
||||||
|
"start_address": 0, //起始地址
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value_name": "MW1", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3是读
|
||||||
|
"start_address": 1, //起始地址偏移1位
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 通信测试
|
## 通信测试
|
||||||
|
|
||||||
(1)共测试INT16共1种类型数据。
|
(1) 新增1个通信demo,命名为schneider_m241.c;
|
||||||
|
|
||||||
(2)测试MW区数据。
|
(2) 复制样例代码程序到schneider_m241.c文件中;
|
||||||
|
|
||||||
(3)MW区数据测试,用功能码03,以字为单位读取。如读MW100,则配方文件中起始地址则直接写100即可。
|
(3) void **ControlSCHNEIDERM241Test**(void) 更改函数名;
|
||||||
|
|
||||||
|
(4) PRIV_SHELL_CMD_FUNCTION(**ControlM241Test**, **Schneider M241 Demo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
|
||||||
|
|
||||||
|
(5) 剪裁配置完成后,用过烧写器下载至矽达通中,重启后完成测试。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# XINJIE 通信测试
|
# XINJE通信测试
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
|
@ -12,12 +12,55 @@
|
||||||
|
|
||||||
- 存储区M、D区。
|
- 存储区M、D区。
|
||||||
|
|
||||||
|
## JSON配方设计
|
||||||
|
|
||||||
|
* 共测试BOOL,INT16共2种类型数据,以下为JSON文件解释。
|
||||||
|
|
||||||
|
- ```json
|
||||||
|
{
|
||||||
|
"device_id": 1, //设备ID默认是1,此参数无效
|
||||||
|
"device_name": "XDH", //设备名称,自定义
|
||||||
|
"communication_type": 0, //通讯协议类型 0是以太网,1是串口
|
||||||
|
"socket_config": { //以太网配置
|
||||||
|
"plc_ip": "192.168.250.32", //PLC的IP地址
|
||||||
|
"local_ip": "192.168.250.233", //矽达通IP地址设定
|
||||||
|
"gateway": "192.168.250.1", //矽达通的网关地址设定
|
||||||
|
"netmask": "255.255.255.0", //矽达通子网掩码设定
|
||||||
|
"port":502 //端口号设定
|
||||||
|
},
|
||||||
|
"protocol_type": 3, //通讯协议,3代表modbus-tcp协议
|
||||||
|
"read_period": 100, //交互周期ms
|
||||||
|
"read_item_list": [
|
||||||
|
{
|
||||||
|
"value_name": "MW0", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3是读
|
||||||
|
"start_address": 0, //起始地址
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value_name": "MW1", //变量名称,自定义
|
||||||
|
"value_type": 3, //变量类型,BOOL = 1,INT8 = 2,INT16,INT32,UINT8,UINT16,UINT32,DOUBLE,FLOAT = 9
|
||||||
|
"function_code": 3, //功能码。3是读
|
||||||
|
"start_address": 1, //起始地址偏移1位
|
||||||
|
"data_length": 1 //BOOL长度,默认是1,代表读取1个BOOL长度
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## 通信测试
|
## 通信测试
|
||||||
|
|
||||||
(1)共测试BOOL,INT16共2种类型数据。
|
(1) 新增1个通信demo,命名为xinje_xdh.c;
|
||||||
|
|
||||||
(2)测试M区及D区数据。
|
(2) 复制样例代码程序到xinje_xdh.c文件中;
|
||||||
|
|
||||||
(3)D区数据测试,用功能码03和06,以字为单位读写。如读写D500,则配方文件中起始地址则直接写500即可。
|
(3) void **ControlXINJEXDHTest**(void) 更改函数名;
|
||||||
|
|
||||||
(4)M区数据测试,用功能码01和05,以位为单位读写。如读写M19,则配方文件中起始地址则直接写19即可。
|
(4) PRIV_SHELL_CMD_FUNCTION(**ControlXINJEXDHTest**, **Omron Plc Cp1l Demo**, PRIV_SHELL_CMD_MAIN_ATTR);更改测试指令;
|
||||||
|
|
||||||
|
(5) 剪裁配置完成后,用过烧写器下载至矽达通中,重启后完成测试。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,10 +62,6 @@ PART += COMPILE_KERNEL
|
||||||
else ifeq ($(CONFIG_COMPILER_APP)_$(CONFIG_COMPILER_KERNEL),y_y)
|
else ifeq ($(CONFIG_COMPILER_APP)_$(CONFIG_COMPILER_KERNEL),y_y)
|
||||||
PART := COMPILE_APP COMPILE_KERNEL
|
PART := COMPILE_APP COMPILE_KERNEL
|
||||||
|
|
||||||
else ifeq ($(CONFIG_MCUBOOT_BOOTLOADER), y)
|
|
||||||
PART := COMPILE_BOOTLOADER
|
|
||||||
else ifeq ($(CONFIG_MCUBOOT_APPLICATION), y)
|
|
||||||
PART := COMPILE_APPLICATION
|
|
||||||
else
|
else
|
||||||
PART :=
|
PART :=
|
||||||
|
|
||||||
|
@ -77,9 +73,16 @@ ifeq ($(CONFIG_RESOURCES_LWIP), y)
|
||||||
PART += COMPILE_LWIP
|
PART += COMPILE_LWIP
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_MCUBOOT_BOOTLOADER), y)
|
||||||
|
PART += COMPILE_BOOTLOADER
|
||||||
|
else ifeq ($(CONFIG_MCUBOOT_APPLICATION), y)
|
||||||
|
PART += COMPILE_APPLICATION
|
||||||
|
else
|
||||||
PART += COMPILE_ALL
|
PART += COMPILE_ALL
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: $(PART)
|
all: $(PART)
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ struct UsartHwCfg
|
||||||
#define FCG_TMR0_CLK FCG_Fcg2PeriphClockCmd
|
#define FCG_TMR0_CLK FCG_Fcg2PeriphClockCmd
|
||||||
#define FCG_DMA_CLK FCG_Fcg0PeriphClockCmd
|
#define FCG_DMA_CLK FCG_Fcg0PeriphClockCmd
|
||||||
|
|
||||||
#define KERNEL_CONSOLE_BUS_NAME SERIAL_BUS_NAME_3
|
#define KERNEL_CONSOLE_BUS_NAME SERIAL_BUS_NAME_6
|
||||||
#define KERNEL_CONSOLE_DRV_NAME SERIAL_DRV_NAME_3
|
#define KERNEL_CONSOLE_DRV_NAME SERIAL_DRV_NAME_6
|
||||||
#define KERNEL_CONSOLE_DEVICE_NAME SERIAL_3_DEVICE_NAME_0
|
#define KERNEL_CONSOLE_DEVICE_NAME SERIAL_6_DEVICE_NAME_0
|
||||||
|
|
||||||
int HwUsartInit(void);
|
int HwUsartInit(void);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ menuconfig BSP_USING_UART3
|
||||||
|
|
||||||
menuconfig BSP_USING_UART6
|
menuconfig BSP_USING_UART6
|
||||||
bool "Enable USART6"
|
bool "Enable USART6"
|
||||||
default n
|
default y
|
||||||
if BSP_USING_UART6
|
if BSP_USING_UART6
|
||||||
config SERIAL_BUS_NAME_6
|
config SERIAL_BUS_NAME_6
|
||||||
string "serial bus 6 name"
|
string "serial bus 6 name"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
export CROSS_COMPILE ?=/usr/bin/arm-none-eabi-
|
||||||
|
|
||||||
export CFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -fgnu89-inline -Wa,-mimplicit-it=thumb
|
export CFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O1 -fgnu89-inline -Wa,-mimplicit-it=thumb
|
||||||
|
|
||||||
export AFLAGS := -c -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb -gdwarf-2
|
export AFLAGS := -c -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -x assembler-with-cpp -Wa,-mimplicit-it=thumb
|
||||||
### if use USB function, use special lds file because USB uses ITCM
|
### if use USB function, use special lds file because USB uses ITCM
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||||
|
@ -25,7 +25,7 @@ else
|
||||||
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xidatong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
export LFLAGS += -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-xidatong-arm32.map,-cref,-u,Reset_Handler -T $(BSP_ROOT)/link.lds
|
||||||
endif
|
endif
|
||||||
|
|
||||||
export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g
|
export CXXFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Dgcc -O1
|
||||||
|
|
||||||
export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
export APPLFLAGS := -mcpu=cortex-m7 -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ MEMORY
|
||||||
m_interrupts (RX) : ORIGIN = 0x60100000, LENGTH = 0x00000400
|
m_interrupts (RX) : ORIGIN = 0x60100000, LENGTH = 0x00000400
|
||||||
m_text (RX) : ORIGIN = 0x60100400, LENGTH = 0x000FFC00
|
m_text (RX) : ORIGIN = 0x60100400, LENGTH = 0x000FFC00
|
||||||
|
|
||||||
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
|
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00060000
|
||||||
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
||||||
|
|
||||||
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
||||||
|
|
|
@ -60,7 +60,7 @@ MEMORY
|
||||||
m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400
|
m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400
|
||||||
m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x0007DC00
|
m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x0007DC00
|
||||||
|
|
||||||
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
|
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00060000
|
||||||
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
||||||
|
|
||||||
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
||||||
|
|
|
@ -58,7 +58,7 @@ MEMORY
|
||||||
|
|
||||||
m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400
|
m_interrupts (RX) : ORIGIN = 0x60002000, LENGTH = 0x00000400
|
||||||
m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x03FFDC00
|
m_text (RX) : ORIGIN = 0x60002400, LENGTH = 0x03FFDC00
|
||||||
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
|
m_data (RW) : ORIGIN = 0x20000000, LENGTH = 0x00060000
|
||||||
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
m_data2 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00060000
|
||||||
|
|
||||||
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
m_sdram (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
|
||||||
|
|
Loading…
Reference in New Issue