From 8202e08c9c2d68fb76f0269b49576d38fa867c46 Mon Sep 17 00:00:00 2001 From: jqy1988 Date: Tue, 28 Nov 2023 15:05:06 +0800 Subject: [PATCH] add panasonic fpxh plc test json file --- .../json/test_recipe_panasonic_fpxh_tcp.json | 65 ++++++++++++++++++ .../json/test_recipe_panasonic_fpxh_uart.json | 66 +++++++++++++++++++ .../Framework/control/shared/control_io.c | 2 +- 3 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json create mode 100644 APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json new file mode 100644 index 000000000..3ee81bdea --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_tcp.json @@ -0,0 +1,65 @@ +{ + "device_id": 1, + "device_name": "PANASONIC_FPXH_TCP", + "communication_type": 0, + "socket_config": { + "plc_ip": "192.168.250.51", + "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": "Y0", + "value_type": 1, + "function_code": 1, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "R0", + "value_type": 1, + "function_code": 1, + "start_address":2048, + "quantity": 1 + }, + { + "value_name": "R100", + "value_type": 1, + "function_code": 1, + "start_address": 2208, + "quantity": 1 + }, + { + "value_name": "R101", + "value_type": 1, + "function_code": 1, + "start_address": 2209, + "quantity": 1 + }, + { + "value_name": "DT0", + "value_type": 3, + "function_code": 3, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "DT1", + "value_type": 3, + "function_code": 3, + "start_address": 1, + "quantity": 1 + }, + { + "value_name": "DT200", + "value_type": 3, + "function_code": 3, + "start_address": 200, + "quantity": 1 + } + ] +} \ No newline at end of file diff --git a/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json new file mode 100644 index 000000000..13d81a7b7 --- /dev/null +++ b/APP_Framework/Applications/control_app/plc_demo/panasonic/json/test_recipe_panasonic_fpxh_uart.json @@ -0,0 +1,66 @@ +{ + "device_id": 1, + "device_name": "PANASONIC_FPXH_RTU", + "communication_type": 1, + "serial_config": { + "station": 1, + "baud_rate": 9600, + "data_bits": 8, + "stop_bits": 1, + "check_mode":3 + }, + "protocol_type": 3, + "read_period": 2000, + "read_item_list": [ + { + "value_name": "Y0", + "value_type": 1, + "function_code": 1, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "R0", + "value_type": 1, + "function_code": 1, + "start_address":2048, + "quantity": 1 + }, + { + "value_name": "R100", + "value_type": 1, + "function_code": 1, + "start_address": 2208, + "quantity": 1 + }, + { + "value_name": "R101", + "value_type": 1, + "function_code": 1, + "start_address": 2209, + "quantity": 1 + }, + { + "value_name": "DT0", + "value_type": 3, + "function_code": 3, + "start_address": 0, + "quantity": 1 + }, + { + "value_name": "DT1", + "value_type": 3, + "function_code": 3, + "start_address": 1, + "quantity": 1 + }, + { + "value_name": "DT200", + "value_type": 3, + "function_code": 3, + "start_address": 200, + "quantity": 1 + } + + ] +} \ No newline at end of file diff --git a/APP_Framework/Framework/control/shared/control_io.c b/APP_Framework/Framework/control/shared/control_io.c index f66917152..c5c7c7b37 100644 --- a/APP_Framework/Framework/control/shared/control_io.c +++ b/APP_Framework/Framework/control/shared/control_io.c @@ -97,7 +97,7 @@ void Uart485Init(uint32_t baud_rate, uint8_t data_bits, uint8_t stop_bits, uint8 cfg.port_configure = PORT_CFG_INIT; #endif cfg.serial_timeout = 10000; - + cfg.dev_recv_callback=NULL; ioctl_cfg.ioctl_driver_type = SERIAL_TYPE; ioctl_cfg.args = &cfg; ret = PrivIoctl(uart_fd, OPE_INT, &ioctl_cfg);