From 288d78f66ecd1b628e8d1df7a3da99fc5e6880ec Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 08 十二月 2023 14:13:37 +0800
Subject: [PATCH] debug

---
 pkg/plc/modbusx/connection_manager.go |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/pkg/plc/modbusx/connection_manager.go b/pkg/plc/modbusx/connection_manager.go
index 4389fe5..b8b83ad 100644
--- a/pkg/plc/modbusx/connection_manager.go
+++ b/pkg/plc/modbusx/connection_manager.go
@@ -3,7 +3,6 @@
 import (
 	"apsClient/conf"
 	"apsClient/model/common"
-	"apsClient/pkg/logx"
 	"github.com/goburrow/modbus"
 	"sync"
 	"time"
@@ -101,15 +100,9 @@
 	rtuHandler = modbus.NewRTUClientHandler(c.SerialName)
 	rtuHandler.BaudRate = c.BaudRate
 	rtuHandler.DataBits = c.DataBit
-	rtuHandler.Parity = c.Parity.String()
+	rtuHandler.Parity = c.Parity.ToString()
 	rtuHandler.StopBits = c.StopBit
 	rtuHandler.SlaveId = 1
 	rtuHandler.Timeout = 5 * time.Second
-
-	err := rtuHandler.Connect()
-	if err != nil {
-		logx.Errorf("getModbusRTUConnection  Connect err:%v, config: %+v", err, c)
-		return nil
-	}
 	return modbus.NewClient(rtuHandler)
 }

--
Gitblit v1.8.0