modbus_rtu

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name                = "modbus_rtu"
	FuncEntityAction    = "entityAction"
	DeviceTypeModbusRtu = node.DeviceType("modbus_rtu")
)
View Source
const (
	AttrSlaveId  = "slave_id"  // 1-32
	AttrBaud     = "baud"      // 9600, 19200, ...
	AttrDataBits = "data_bits" // 5-9
	AttrTimeout  = "timeout"   // milliseconds
	AttrStopBits = "stop_bits" // 1-2
	AttrSleep    = "sleep"     // milliseconds
	AttrParity   = "parity"    // none, odd, even
)

Variables

This section is empty.

Functions

func New

func New() plugins.Plugable

func NewAttr

func NewAttr() m.Attributes

func NewModbusRtu

func NewModbusRtu(eventBus event_bus.EventBus, actor *Actor) (modbus modbusRtu)

func NewSettings

func NewSettings() m.Attributes

Types

type Actor

type Actor struct {
	entity_manager.BaseActor
	// contains filtered or unexported fields
}

func NewActor

func NewActor(entity *m.Entity,
	entityManager entity_manager.EntityManager,
	adaptors *adaptors.Adaptors,
	scriptService scripts.ScriptService,
	eventBus event_bus.EventBus) (actor *Actor)

func (*Actor) SetState

func (e *Actor) SetState(params entity_manager.EntityStateParams) error

func (*Actor) Spawn

func (e *Actor) Spawn() entity_manager.PluginActor

type ModBusCommand

type ModBusCommand struct {
	Function string   `json:"function"`
	Address  uint16   `json:"address"`
	Count    uint16   `json:"count"`
	Command  []uint16 `json:"command"`
}

ModBusCommand ...

type ModBusResponse

type ModBusResponse struct {
	Error  string   `json:"error"`
	Time   float64  `json:"time"`
	Result []uint16 `json:"result"`
}

ModBusResponse ...

Jump to

Keyboard shortcuts

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