From 37f7f87968cfd2c400283fbf83851c39c2c4d456 Mon Sep 17 00:00:00 2001 From: wu <731351411@qq.com> Date: 星期三, 20 十二月 2023 08:12:26 +0800 Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes --- springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java b/springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java index 896be4c..16fa085 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/PLCManualJog.java @@ -33,26 +33,18 @@ } catch (InterruptedException e) { e.printStackTrace(); } - // this.readValue(); - // String PlcAddress = this.name; - // Integer Plccount = this.count; - - // System.out.println(stt); - List<String> addressList21 = Arrays.asList(config.getProperty("PLCManualJog.button").split(",")); + List<String> addressList21 = Arrays.asList(config.getProperty("PLCManualJog.button").split(",")); + List<Boolean> arraylist = S7control.getinstance().readBits(addressList21); - List<Boolean> arraylist = S7control.getinstance().readBits(addressList21); +// Boolean[] values1 = { false, true, true, true, false, false, true, false, +// false, true, true, true, false, false, +// true, false,false, true, true, true, false, false, true, false, +// false, true, false, true }; +// List<Boolean> arraylist = new ArrayList<>(Arrays.asList(values1)); - // Boolean[] values1 = { false, true, true, true, false, false, true, false, - // false, true, true, true, false, false, - // true, false }; - // List<Boolean> arraylist = new ArrayList<>(Arrays.asList(values1)); - // Boolean[] values2 = { false, true, true, true, false, false, true, false }; - // List<Boolean> arraylist2 = new ArrayList<>(Arrays.asList(values2)); - // Boolean[] values3 = { false, false }; - // List<Boolean> arraylist3 = new ArrayList<>(Arrays.asList(values3)); JSONObject jsonObject = new JSONObject(); @@ -109,13 +101,13 @@ List<Boolean> bolList = new ArrayList<>(); - for (int i = 0; i < 26 && i < messageBooleans.size(); i++) { + for (int i = 0; i < 28 && i < messageBooleans.size(); i++) { bolList.add(messageBooleans.get(i)); } if (!bolList.isEmpty()) { - S7control.getinstance().WriteBit(addressList21, bolList); + S7control.getinstance().WriteBit(addressList21, bolList); System.out.println("messageValue锛�" + bolList + " written to PLC at address " + addressList21); } -- Gitblit v1.8.0