modbustools

package module
v0.0.0-...-63b8aca Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(e error)

Check : checks if the input error has a value to "panic" or ignores it if it's nil

func ConvertParity

func ConvertParity(parity int) string

ConvertParity : converts parity from a custom numeric id to the string ids used by relying module

func SetupHandler

func SetupHandler(config SerialConfig) *modbus.RTUClientHandler

SetupHandler : creates and returns a handler to use to read device information

Types

type Client

type Client modbus.Client

Client from modbus

type SerialConfig

type SerialConfig struct {
	// Serial port configuration.
	serial.Config
	IdleTimeout time.Duration
}

SerialConfig : struct object to store serial configuration

func SetupConfig

func SetupConfig(address string, baudRate int, dataBits int, stopBits int, parity string, timeout int64) SerialConfig

SetupConfig : creates and returns an object with the given configuration

func TypicalConfig

func TypicalConfig() SerialConfig

TypicalConfig : creates and returns a typical configuration object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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