Documentation ¶
Index ¶
- type ModbusTcp
- func (m *ModbusTcp) Open()
- func (m *ModbusTcp) ReadCoilStatus(Id uint8, RegisterAddress, Length uint16) (Data []bool, err error)
- func (m *ModbusTcp) ReadHoldingRegister(Id uint8, RegisterAddress, Length uint16) (Data []byte, err error)
- func (m *ModbusTcp) ReadInputRegister(Id uint8, RegisterAddress, Length uint16) (Data []byte, err error)
- func (m *ModbusTcp) ReadInputStatus(Id uint8, RegisterAddress, Length uint16) (Data []bool, err error)
- func (m *ModbusTcp) WriteMultipleCoilStatus(Id uint8, RegisterAddress uint16, Data []bool) (err error)
- func (m *ModbusTcp) WriteMultipleHoldingRegister(Id uint8, RegisterAddress uint16, Data []byte) (err error)
- func (m *ModbusTcp) WriteSingleCoilStatus(Id uint8, RegisterAddress uint16, Data bool) (err error)
- func (m *ModbusTcp) WriteSingleHoldingRegister(Id uint8, RegisterAddress uint16, Data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModbusTcp ¶
type ModbusTcp struct { //IP地址加端口 Ip string //是否启用自动重连 AutoReConnect bool //超时 Timeout int // contains filtered or unexported fields }
func (*ModbusTcp) ReadCoilStatus ¶
func (m *ModbusTcp) ReadCoilStatus(Id uint8, RegisterAddress, Length uint16) (Data []bool, err error)
ReadCoilStatus 读取线圈状态
func (*ModbusTcp) ReadHoldingRegister ¶
func (m *ModbusTcp) ReadHoldingRegister(Id uint8, RegisterAddress, Length uint16) (Data []byte, err error)
ReadHoldingRegister 读取保持寄存器
func (*ModbusTcp) ReadInputRegister ¶
func (m *ModbusTcp) ReadInputRegister(Id uint8, RegisterAddress, Length uint16) (Data []byte, err error)
ReadInputRegister 读取输入寄存器
func (*ModbusTcp) ReadInputStatus ¶
func (m *ModbusTcp) ReadInputStatus(Id uint8, RegisterAddress, Length uint16) (Data []bool, err error)
ReadInputStatus 读取输入状态
func (*ModbusTcp) WriteMultipleCoilStatus ¶
func (m *ModbusTcp) WriteMultipleCoilStatus(Id uint8, RegisterAddress uint16, Data []bool) (err error)
WriteMultipleCoilStatus 写多个线圈
func (*ModbusTcp) WriteMultipleHoldingRegister ¶
func (m *ModbusTcp) WriteMultipleHoldingRegister(Id uint8, RegisterAddress uint16, Data []byte) (err error)
WriteMultipleHoldingRegister 写多个保持寄存器
func (*ModbusTcp) WriteSingleCoilStatus ¶
WriteSingleCoilStatus 写单个线圈
Click to show internal directories.
Click to hide internal directories.