From e7eaa7bb402aae3bb88d9219e50f0e1179f3257f Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 26 十二月 2023 09:28:52 +0800 Subject: [PATCH] layout 布局页增加A01 A02终止继续后选择 弹框 --- springboot-vue3/src/main/java/com/example/springboot/component/S7control.java | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java index a5f3e44..95ebb15 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java @@ -215,7 +215,15 @@ if (s7PLC==null) return null; // List<String> addresslist = GetAddressList(address, count, 16); - return s7PLC.readByte(address,count); + + try { + return s7PLC.readByte(address, count); + }catch (Exception e) { + // 澶勭悊寮傚父 + System.out.println("璇诲彇 " + address + " 澶辫触锛�" + e.getMessage()); + return null; + } + } /** -- Gitblit v1.8.0