Jelajahi Sumber

提示修改

jwk 2 tahun lalu
induk
melakukan
e7549ceee3

+ 2 - 1
src/main/java/com/jwk/spring/boot/modbus4j/ModbusTcpMaster.java

@@ -69,9 +69,10 @@ public class ModbusTcpMaster {
                 master = modbusFactory.createTcpMaster(params, true);
                 master.init();
                 modbusMasterUtil = new ModbusMasterUtil(master);
+                log.error("ModbusTcp:{}:{},连接成功!", getHost(), getPort());
                 break;
             } catch (Exception e) {
-                log.error("当前串口:{},打开失败!", getPort(), e);
+                log.error("当前地址:{}:{},连接失败!", getHost(), getPort(), e);
                 try {
                     Thread.sleep(3000);
                 } catch (InterruptedException ee) {