Categorygithub.com/andig/mbserver
modulepackage
0.0.0-20230310211055-1d29cbb5820e
Repository: https://github.com/andig/mbserver.git
Documentation: pkg.go.dev

# README

Go modbus server

This repo is a simplified version of github.com/simonvetter/modbus

The main changes are:

  • simplified the modbus server
  • removed TLS handling (this should be done in the calling application)
  • added an Option interface to creating the server
  • added a DummyHandler
  • removed modbus client (use github.com/grid-x/modbus)

Description

This package is a go implementation of the modbus protocol. It aims to provide a simple-to-use, high-level API to interact with modbus devices using native Go types.

Please note that UDP transports are not part of the Modbus specification. Some devices expect MBAP (modbus TCP) framing in UDP packets while others use RTU frames instead. The client support both so if unsure, try with both udp:// and rtuoverudp:// schemes.

The server supports:

  • modbus TCP (a.k.a. MBAP)

License

MIT.

# Functions

Logger is the modbus server logger option.
MapExceptionCodeToError turns a modbus exception code into a higher level Error object.
MaxClients is the modbus server maximum concurrent clients option.
Returns a new modbus server.
Timeout is the modbus server timeout option.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
errors.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
word order of 32-bit registers.
No description provided by the author

# Structs

Request object passed to the coil handler.
Request object passed to the discrete input handler.
No description provided by the author
Request object passed to the holding register handler.
Request object passed to the input register handler.
Modbus server object.

# Interfaces

No description provided by the author
The RequestHandler interface should be implemented by the handler object passed to NewServer (see reqHandler in NewServer()).

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author