From 080a3a42da0f4244f4f078b62f10bad11156a5a0 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 17 八月 2020 13:45:55 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/thread/DevpThread.java | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zy/core/thread/DevpThread.java b/src/main/java/com/zy/core/thread/DevpThread.java index fd11333..387fef4 100644 --- a/src/main/java/com/zy/core/thread/DevpThread.java +++ b/src/main/java/com/zy/core/thread/DevpThread.java @@ -31,12 +31,12 @@ public DevpThread(Slave slave) { this.slave = slave; - connect(); } @Override @SuppressWarnings("InfiniteLoopStatement") public void run() { + connect(); while (true) { try { int step = 1; @@ -140,11 +140,12 @@ Slave slave = new Slave(); slave.setIp("192.168.2.125"); DevpThread devpThread = new DevpThread(slave); + devpThread.connect(); devpThread.read(); // 鍐� StaProtocol staProtocol = devpThread.getStation().get(1); - staProtocol.setWorkNo((short) 888); - staProtocol.setStaNo((short) 1001); + staProtocol.setWorkNo((short) 232); + staProtocol.setStaNo((short) 6); staProtocol.setAutoing(true); staProtocol.setEmptyMk(true); staProtocol.setInEnable(true); -- Gitblit v1.9.1