Documentation ¶
Index ¶
- Constants
- func CoilsToBytes(rgc config.RegisterGroupConfig, values []bool) []byte
- func RegistersToBytes(rgc config.RegisterGroupConfig, values []uint16) []byte
- func StartBytes(slave uint8, functionCode uint16, address uint16, numberOfRegisters uint16) []byte
- type Collector
- type LineReader
- type ModbusClient
- type ModbusReader
- type UdpListenerReader
Constants ¶
View Source
const MaximumNumberOfCoils = 2000
View Source
const MaximumNumberOfRegisters = 125
MaximumNumberOfRegisters is maximum number of registers that can be read in one request, a modbus message is limit to 256 bytes TODO: this should be checked when register groups are created
Variables ¶
This section is empty.
Functions ¶
func CoilsToBytes ¶ added in v0.1.9
func CoilsToBytes(rgc config.RegisterGroupConfig, values []bool) []byte
func RegistersToBytes ¶ added in v0.1.9
func RegistersToBytes(rgc config.RegisterGroupConfig, values []uint16) []byte
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader reads lines from the connection and sends it on the mangos socket
func NewLineReader ¶
func NewLineReader(c *config.CollectorConfig) (*LineReader, error)
func (*LineReader) Collect ¶
func (r *LineReader) Collect(publisher mangos.Socket)
type ModbusClient ¶
type ModbusClient struct {
// contains filtered or unexported fields
}
func (*ModbusClient) Poll ¶
func (m *ModbusClient) Poll(stream chan<- []byte, rgc config.RegisterGroupConfig) error
func (*ModbusClient) Read ¶
func (m *ModbusClient) Read(rgc config.RegisterGroupConfig) ([]byte, error)
type ModbusReader ¶
type ModbusReader struct {
// contains filtered or unexported fields
}
func NewModbusReader ¶
func NewModbusReader(c *config.CollectorConfig, rgs []config.RegisterGroupConfig) (*ModbusReader, error)
func (*ModbusReader) Collect ¶
func (r *ModbusReader) Collect(publisher mangos.Socket)
type UdpListenerReader ¶
type UdpListenerReader struct {
// contains filtered or unexported fields
}
UdpListenerReader implements the io.Reader interface
Click to show internal directories.
Click to hide internal directories.