From aab066ab2d90d235848f67d4aac3b15c8f778b3c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期六, 19 八月 2023 18:37:07 +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