From e6c81b3916494ef51edc21774a27402d0f16c49c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 24 八月 2023 17:21:04 +0800 Subject: [PATCH] plc配置支持serial和modbusTCP两种方式 --- api/v1/plc.go | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/api/v1/plc.go b/api/v1/plc.go index 1ae6174..3f8238d 100644 --- a/api/v1/plc.go +++ b/api/v1/plc.go @@ -10,6 +10,7 @@ "apsClient/pkg/plc" "apsClient/service" "encoding/binary" + "fmt" "github.com/gin-gonic/gin" ) @@ -44,7 +45,7 @@ valueType = pc.Type dataLength = pc.Length } - ipAddr = plcConfig.Address + ipAddr = fmt.Sprintf("%s:%v", plcConfig.Address, plcConfig.Port) } resp := new(response.ProductProgress) -- Gitblit v1.8.0