From 620d904921c76b6b29d1b69787da7a82121d4c31 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 26 十月 2023 21:15:35 +0800 Subject: [PATCH] 读写plc支持modbusRTU --- model/common/common.go | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/model/common/common.go b/model/common/common.go index 3a8781f..d616014 100644 --- a/model/common/common.go +++ b/model/common/common.go @@ -157,3 +157,11 @@ DataType PullDataType `json:"dataType"` //瑕佹媺鍙栫殑鏁版嵁绫诲瀷 Data interface{} //杩斿洖鐨勬暟鎹� } + +type RTUConfig struct { + BaudRate int `json:"baudRate"` //涓插彛娉㈢壒鐜囷紝 method = serial鏃� 鐢� + SerialName string `json:"serialName"` //涓插彛鍚嶇О锛宮ethod = serial鏃� 鐢� + DataBit int `gorm:"type:int(11)" json:"dataBit"` //鏁版嵁浣嶏紝method = modbusRTU 鐢� + StopBit int `gorm:"type:int(11)" json:"stopBit"` //鍋滄浣嶏紝method = modbusRTU 鐢� + Parity constvar.Parity `gorm:"type:int(11)" json:"parity"` //鏍¢獙鏂瑰紡锛宮ethod = modbusRTU 鐢� +} -- Gitblit v1.8.0