24 lines
553 B
Go
24 lines
553 B
Go
|
package modbus
|
||
|
|
||
|
// 功能码
|
||
|
type FunctionCode int
|
||
|
|
||
|
const (
|
||
|
// 读线圈
|
||
|
FCReadCoil FunctionCode = 0x01
|
||
|
// 读离散输入
|
||
|
FCReadDiscreteInput FunctionCode = 0x02
|
||
|
// 读多个寄存器
|
||
|
FCReadHoldingRegister FunctionCode = 0x03
|
||
|
// 读输入寄存器
|
||
|
FCReadInputRegister FunctionCode = 0x04
|
||
|
// 写单个线圈
|
||
|
FCWriteSingleCoil FunctionCode = 0x05
|
||
|
// 写单个寄存器
|
||
|
FCWriteSingleRegister FunctionCode = 0x06
|
||
|
// 写多个线圈
|
||
|
FCWriteMultipleCoil FunctionCode = 0x0F
|
||
|
// 写多个寄存器
|
||
|
FCWriteMultipleRegister FunctionCode = 0x10
|
||
|
)
|