From 31ad9a7e8bf9b60c5a26f6408a5455c10bb5b9e4 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 21 八月 2023 10:47:22 +0800
Subject: [PATCH] 下发工艺参数模拟改真实写入
---
pkg/plc/plc4x.go | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/pkg/plc/plc4x.go b/pkg/plc/plc4x.go
index 8afb487..3e6c4a6 100644
--- a/pkg/plc/plc4x.go
+++ b/pkg/plc/plc4x.go
@@ -98,6 +98,14 @@
return result, nil
}
+func ReadHoldingRegister(connection plc4go.PlcConnection, address, length int) ([]byte, error) {
+ if length > 1 {
+ return ReadHoldingRegisterList(connection, address, length)
+ }
+
+ return ReadHoldingRegisterSingle(connection, address)
+}
+
func WriteHoldingRegister(connection plc4go.PlcConnection, address int, value any) (string, error) {
tagAddress := fmt.Sprintf("holding-register:%d:UINT", address)
--
Gitblit v1.8.0