Help us shape the future of Go! Take the 2026 Go Developer Survey

structures

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]*Params

Config structure declaration

type DataUnit

type DataUnit struct {
	Address                                      map[string]uint16
	Value                                        float64
	SiName, Type, ByteOrder, WordOrder, FuncCode string
	Labels                                       map[string]string
}

DataUnit structure declaration

func NewDataUnit

func NewDataUnit(
	Address map[string]uint16,
	Value float64,
	SiName string,
	Type string,
	ByteOrder string,
	WordOrder string,
	FuncCode string,
	Labels map[string]string,
) *DataUnit

NewDataUnit returns a DataUnit ready to use.

type Device

type Device struct {
	Timeout, RequestDelay string
	ModbusID              byte
	ZeroBased             bool
}

Device structure declaration

func NewDevice

func NewDevice(
	ModbusID byte,
	Timeout string,
	RequestDelay string,
	ZeroBased bool,
) *Device

NewDevice returns a Device ready to use.

type Params

type Params struct {
	DeviceTransport           string            `yaml:"device_transport,omitempty"`
	DeviceTimeout             string            `yaml:"device_timeout,omitempty"`
	DeviceModbusID            byte              `yaml:"device_modbus_id,omitempty"`
	DeviceZeroBasedAddressing bool              `yaml:"device_zero_based_addressing,omitempty"`
	DeviceRequestDelay        string            `yaml:"device_request_delay,omitempty"`
	DeviceLabels              map[string]string `yaml:"device_labels,omitempty"`
	DeviceRegisters           []Register        `yaml:"device_registers"`
}

Params structure declaration

type Register

type Register struct {
	RegisterName      string            `yaml:"register_name"`
	RegisterSiName    string            `yaml:"register_si_name,omitempty"`
	RegisterType      string            `yaml:"register_type,omitempty"`
	RegisterByteOrder string            `yaml:"register_byte_order,omitempty"`
	RegisterWordOrder string            `yaml:"register_word_order,omitempty"`
	RegisterAddress   string            `yaml:"register_address"`
	RegisterFuncCode  string            `yaml:"register_func_code,omitempty"`
	RegisterLabels    map[string]string `yaml:"register_labels,omitempty"`
}

Register structure declaration

func NewRegister

func NewRegister(
	RegisterName string,
	RegisterSiName string,
	RegisterType string,
	RegisterByteOrder string,
	RegisterWordOrder string,
	RegisterAddress string,
	RegisterFuncCode string,
	RegisterLabels map[string]string,
) *Register

NewRegister returns a Register ready to use.

type Registers

type Registers []DataUnit

Registers structure declaration

type SafeConfig

type SafeConfig struct {
	sync.RWMutex
	C *Config
}

SafeConfig structure declaration

func NewSafeConfig

func NewSafeConfig(
	C *Config,
) *SafeConfig

NewSafeConfig return a SafeConfig ready to use.

Jump to

Keyboard shortcuts

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