nmodbus

package
v0.0.0-...-e22671d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ModbusDevices

type ModbusDevices struct {
	Points     map[string]ModbusPoint
	UUID       string
	DeviceIP   string
	DevicePort int
	DeviceAddr int
}

func NewDevice

func NewDevice(uuid, deviceIP string, devicePort, deviceAddr int) *ModbusDevices

NewDevice creates a new Modbus device.

func (*ModbusDevices) AddPoint

func (d *ModbusDevices) AddPoint(point ModbusPoint)

AddPoint adds a new point to the device.

func (*ModbusDevices) GetPoint

func (d *ModbusDevices) GetPoint(uuid string) (ModbusPoint, bool)

GetPoint returns a point with the specified UUID.

func (*ModbusDevices) GetPoints

func (d *ModbusDevices) GetPoints() map[string]ModbusPoint

GetPoints returns all points of a device.

type ModbusNetworks

type ModbusNetworks struct {
	UUID    string
	Devices map[string]*ModbusDevices
}

func NewModbusNetwork

func NewModbusNetwork(uuid string) *ModbusNetworks

NewModbusNetwork creates a new Modbus network.

func (*ModbusNetworks) AddDevice

func (m *ModbusNetworks) AddDevice(device *ModbusDevices)

AddDevice adds a new device to the network.

func (*ModbusNetworks) GetDevices

func (m *ModbusNetworks) GetDevices() map[string]*ModbusDevices

type ModbusPoint

type ModbusPoint struct {
	UUID     string
	Register int
	Function string // e.g., "coil"
	Request  string // e.g., "read" or "write"
}

func NewPoint

func NewPoint(uuid string, register int, function, request string) ModbusPoint

NewPoint creates a new Modbus point.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL