From 72721bf221e6f90fb830bf28133c7588e30e1d30 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 26 十月 2023 17:41:19 +0800 Subject: [PATCH] fix --- constvar/const.go | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/constvar/const.go b/constvar/const.go index 5f6fa74..8976494 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -34,6 +34,7 @@ const ( PlcMethodModbusTCP PlcMethod = "modbusTCP" + PlcMethodModbusRTU PlcMethod = "modbusRTU" PlcMethodSerial PlcMethod = "serial" PlcMethodModbusTCPChinese PlcMethod = "缃戠粶" PlcMethodSerialChinese PlcMethod = "涓插彛" @@ -49,7 +50,7 @@ } func (slf *PlcMethod) Valid() bool { - return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial + return *slf == PlcMethodModbusTCP || *slf == PlcMethodSerial || *slf == PlcMethodModbusRTU } const ( @@ -70,3 +71,11 @@ TaskModeCurrent TaskMode = 2 //鏈紑濮嬬殑鍜岃繘琛屼腑鐨� TaskModeLastFinished TaskMode = 3 //涓婁竴涓粨鏉熺殑 ) + +type Parity int + +const ( + ParityEven Parity = 1 //濂囨牎楠� + ParityOdd Parity = 2 //鍋舵牎楠� + ParityNull Parity = 3 //鏃犳牎楠� +) -- Gitblit v1.8.0