Documentation
¶
Index ¶
- func CrcAppend(data []byte) []byte
- func CrcCheck(data []byte) bool
- func Query(m *Master, data []byte) ([]byte, error)
- type Master
- func (m *Master) ReadCoil(id uint8, addr uint16, leng uint16) ([]bool, error)
- func (m *Master) ReadCoilIn(id uint8, addr uint16, leng uint16) ([]bool, error)
- func (m *Master) ReadReg(id uint8, addr uint16, leng uint16) ([]uint16, error)
- func (m *Master) ReadRegIn(id uint8, addr uint16, leng uint16) ([]uint16, error)
- func (m *Master) WriteCoil(id uint8, addr uint16, data bool) error
- func (m *Master) WriteCoils(id uint8, addr uint16, data []bool) error
- func (m *Master) WriteReg(id uint8, addr uint16, data uint16) error
- func (m *Master) WriteRegs(id uint8, addr uint16, data []uint16) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Master ¶
type Master struct {
Comport string
BaudRate int
DataBits int
StopBits int
Parity string
Timeout time.Duration
}
Master Modbus Master config
func (*Master) ReadCoilIn ¶
ReadCoilIn mdbus function 2 query and return []uint16
func (*Master) WriteCoils ¶
WriteCoils mdbus function 15(0x0f) query and return []uint16
Click to show internal directories.
Click to hide internal directories.