Giter VIP home page Giter VIP logo

modbus's Introduction

ModBus

Library for Modbus, master/slave, ASCII/RTU, multi-platform, C language

ModBus 主/从机协议

  • 支持 ASCII / RTU 两种模式

  • 可以创建多个实例

  • 读写寄存器使用非堵塞式, 通过绑定回调函数获取结果

使用方法:

主机
  1. 调用ModBus_setup配置

  2. 在串口接收中断函数中调用ModBus_readByteFromOuter

  3. 循环调用ModBus_Master_loop

  4. 读写从机寄存器

    • 调用ModBus_getRegister读目标设备寄存器值

    • 调用ModBus_setRegister写目标设备单寄存器

    • 调用ModBus_setRegisters写目标设备多寄存器

从机
  1. 调用ModBus_setup配置参数

  2. 调用ModBus_attachRegisterHandler绑定获取和设置寄存器的函数

  3. 在loop中调用ModBus_Slave_loop

函数形参看头文件对外接口部分

modbus's People

Contributors

wql7013 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.