# A groovy modbus library
![Build Status](https://github.com/stephane/libmodbus/actions/workflows/build.yml/badge.svg)
## Overview
libmodbus is a free software library to send/receive data with a device which
respects the Modbus protocol. This library can use a serial port or an Ethernet
connection.
The functions included in the library have been derived from the Modicon Modbus
Protocol Reference Guide which can be obtained from [www.modbus.org](http://www.modbus.org).
The license of libmodbus is *LGPL v2.1 or later*.
The official website is [www.libmodbus.org](http://www.libmodbus.org). The
website contains the latest version of the documentation.
The library is written in C and designed to run on Linux, Mac OS X, FreeBSD, Embox,
QNX and Windows.
You can use the library on MCUs with Embox RTOS.
## Installation
You will only need to install automake, autoconf, libtool and a C compiler (gcc
or clang) to compile the library and asciidoc and xmlto to generate the
documentation (optional).
To install, just run the usual dance, `./configure && make install`. Run
`./autogen.sh` first to generate the `configure` script if required.
You can change installation directory with prefix option, eg. `./configure
--prefix=/usr/local/`. You have to check that the installation library path is
properly set up on your system (*/etc/ld.so.conf.d*) and library cache is up to
date (run `ldconfig` as root if required).
The library provides a *libmodbus.pc* file to use with `pkg-config` to ease your
program compilation and linking.
If you want to compile with Microsoft Visual Studio, you should follow the
instructions in `./src/win32/README.md`.
To compile under Windows, install [MinGW](http://www.mingw.org/) and MSYS then
select the common packages (gcc, automake, libtool, etc). The directory
*./src/win32/* contains a Visual C project.
To compile under OS X with [homebrew](http://mxcl.github.com/homebrew/), you
will need to install the following dependencies first: `brew install autoconf
automake libtool`.
To build under Embox, you have to use its build system.
## Testing
Some tests are provided in *tests* directory, you can freely edit the source
code to fit your needs (it's Free Software :).
See *tests/README* for a description of each program.
For a quick test of libmodbus, you can run the following programs in two shells:
1. ./unit-test-server
2. ./unit-test-client
By default, all TCP unit tests will be executed (see --help for options).
It's also possible to run the unit tests with `make check`.
## To report a bug or to contribute
See [CONTRIBUTING](CONTRIBUTING.md) document.
## Documentation
You can serve the local documentation with:
```shell
pip install mkdocs-material
mkdocs serve
```
没有合适的资源?快使用搜索试试~ 我知道了~
开源库libmodbus
共125个文件
md:74个
c:12个
h:6个
需积分: 5 14 下载量 85 浏览量
2023-06-27
15:32:36
上传
评论
收藏 244KB ZIP 举报
温馨提示
modbus开源库,2023年新版本,编译方法见主页 https://blog.csdn.net/lhb0709
资源推荐
资源详情
资源评论
收起资源包目录
开源库libmodbus
(125个子文件)
configure.ac 5KB
Makefile.am 1KB
Makefile.am 947B
Makefile.am 306B
AUTHORS 336B
modbus.c 63KB
unit-test-client.c 37KB
modbus-rtu.c 36KB
modbus-tcp.c 23KB
random-test-client.c 9KB
unit-test-server.c 7KB
modbus-data.c 6KB
bandwidth-client.c 6KB
bandwidth-server-many-up.c 4KB
bandwidth-server-one.c 2KB
random-test-server.c 1KB
version.c 727B
.clabot 870B
.clang-format 2KB
.editorconfig 223B
server-grafana.excalidraw 46KB
client-sensors.excalidraw 15KB
.gitignore 621B
.gitignore 63B
modbus.h 12KB
modbus-private.h 3KB
modbus-rtu-private.h 2KB
modbus-tcp.h 1KB
modbus-rtu.h 1KB
modbus-tcp-private.h 1KB
unit-test.h.in 3KB
modbus-version.h.in 2KB
modbus.dll.manifest.in 528B
libmodbus.pc.in 201B
configure.js 5KB
COPYING.LESSER 26KB
LICENSE 1KB
Make-tests 2KB
index.md 10KB
modbus_new_rtu.md 3KB
CODE_OF_CONDUCT.md 3KB
README.md 3KB
ISSUE_TEMPLATE.md 3KB
modbus_mapping_new_start_address.md 3KB
modbus_set_slave.md 2KB
modbus_set_error_recovery.md 2KB
README.md 2KB
modbus_rtu_set_rts.md 2KB
modbus_new_tcp_pi.md 2KB
modbus_send_raw_request.md 2KB
modbus_mapping_new.md 2KB
modbus_new_tcp.md 1KB
modbus_rtu_get_serial_mode.md 1KB
modbus_rtu_set_serial_mode.md 1KB
modbus_report_slave_id.md 1KB
modbus_read_registers.md 1KB
modbus_tcp_listen.md 1KB
modbus_set_response_timeout.md 1KB
modbus_set_byte_timeout.md 1KB
modbus_receive_confirmation.md 1KB
modbus_write_and_read_registers.md 1KB
modbus_tcp_pi_listen.md 1KB
CONTRIBUTING.md 1KB
README.md 1KB
modbus_reply_exception.md 1KB
modbus_read_input_registers.md 1KB
modbus_get_indication_timeout.md 1KB
modbus_reply.md 1KB
modbus_tcp_pi_accept.md 983B
modbus_tcp_accept.md 965B
modbus_set_indication_timeout.md 958B
modbus_enable_quirks.md 951B
modbus_get_response_timeout.md 935B
modbus_rtu_set_custom_rts.md 934B
modbus_receive.md 926B
modbus_set_socket.md 887B
modbus_read_input_bits.md 884B
modbus_read_bits.md 857B
modbus_strerror.md 854B
modbus_get_byte_timeout.md 812B
modbus_disable_quirks.md 798B
modbus_get_float_dcba.md 776B
modbus_connect.md 770B
modbus_get_float_cdab.md 767B
modbus_get_float.md 764B
modbus_get_float_badc.md 763B
modbus_set_debug.md 762B
modbus_get_float_abcd.md 744B
modbus_mask_write_register.md 735B
modbus_write_bits.md 732B
modbus_rtu_get_rts.md 724B
modbus_set_float_cdab.md 712B
modbus_set_float_badc.md 706B
modbus_write_registers.md 689B
modbus_rtu_get_rts_delay.md 681B
modbus_set_float_abcd.md 675B
modbus_set_bits_from_bytes.md 666B
modbus_rtu_set_rts_delay.md 665B
modbus_get_byte_from_bits.md 642B
modbus_set_float.md 637B
共 125 条
- 1
- 2
资源评论
lhb0709
- 粉丝: 1072
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功