Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModbusClient ¶
type ModbusClient struct { Client modbus.Client Handler interface{} Config interface{} // contains filtered or unexported fields }
ModbusClient is the structure for modbus client.
func NewClient ¶
func NewClient(config interface{}) (*ModbusClient, error)
NewClient allocate and return a modbus client. Client type includes TCP and RTU.
func (*ModbusClient) Get ¶
func (c *ModbusClient) Get(registerType string, addr uint16, quantity uint16) (results []byte, err error)
Get get register.
func (*ModbusClient) GetStatus ¶
func (c *ModbusClient) GetStatus() string
GetStatus get device status. Now we could only get the connection status.
Click to show internal directories.
Click to hide internal directories.