From 7687eb6cc76ab8ca20b39e7567255939abc4ff66 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期一, 29 四月 2024 09:16:24 +0800 Subject: [PATCH] 修改进片逻辑判断,添加异常捕获 --- springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java index 6989dec..ddfdf88 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcalarm.java @@ -78,11 +78,7 @@ while (this != null) { try { Thread.sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - this.readValue(); + this.readValue(); String PlcAddress = this.name; Integer Plccount = this.count; @@ -141,7 +137,10 @@ } } } - } + } catch (InterruptedException e) { + e.printStackTrace(); } - } + } + } +} -- Gitblit v1.8.0