Code Monkey home page Code Monkey logo

go-modbus's Introduction

GoDoc Build Status Coverage Status codebeat badge License

go-modbus

About

Modbus protocol framework

Supported

  1. Modbus RTU over TCP
  2. Modbus Slave mode (Modbus Server)
  3. Modbus Master mode (Modbus Client)
  4. Rest server for read/write Modbus Data
  5. gRPC service (Server/Client)
  6. Dump Modbus packets
  7. Function:
  • Read Coil Status (0x1)
  • Read Discrete Inputs (0x2)
  • Read Holding Registers (0x3)
  • Read Input Registers (0x4)
  • Force Single Coil (0x5)
  • Preset Single Register (0x6)
  • Force Multiple Coils (0xF)
  • Preset Multiple Registers (0x10)

Installation

go get github.com/soldatov-s/go-modbus

Next, build and run the examples:

Rest Server

  • /coils - Coils (GET and PUT)
  • /d_in - Discrete Inputs (only GET)
  • /hold_reg - Holding Registers (GET and PUT)
  • /in_reg - Input Registers (only GET)

Example Read Holding Registers:

curl -X GET -i 'http://localhost:8000/hold_reg?addr=0&cnt=5'

Example Write Holding Registers:

curl -X POST -i http://localhost:8000/hold_reg --data '{
"addr": 0,
"data": [77, 11]
}'

More Documentation

More documentation about Modbus is available on the

go-modbus's People

Contributors

soldatov-s avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.