diff --git a/APP_Framework/Applications/control_app/plc_demo/Makefile b/APP_Framework/Applications/control_app/plc_demo/Makefile index 871617c50..b0defb592 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 panasonic +SRC_DIR := advantech beckhoff br delta mitsubishi omron schneider siemens ge xinje inovance keyence panasonic fatek include $(KERNEL_ROOT)/compiler.mk 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..e69de29bb 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/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 088892e67..0bd4d36f7 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 @@ -189,7 +189,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; }