pkg/plc/modbusx/modbusrtu.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
pkg/plc/modbusx/modbusrtu.go
@@ -5,6 +5,7 @@ ) func ReadByRTU(c *common.RTUConfig, address uint16, quantity uint16) (data []byte, err error) { address-- cli := getModbusRTUConnection(c) data, err = cli.ReadHoldingRegisters(address, quantity) dealRTUErr(err, c.SerialName) @@ -17,6 +18,7 @@ } func WriteByRTU(c *common.RTUConfig, address uint16, value int, endian string, length int) (err error) { address-- var bytesVal []byte bytesVal = intToBytes(value, endian, length) cli := getModbusRTUConnection(c)