Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Modbus library for Linux, Mac OS, FreeBSD and Windows

License

NotificationsYou must be signed in to change notification settings

stephane/libmodbus

Build StatusCoverity Scan Build Status

Overview

libmodbus is a free software library to send/receive data with a device whichrespects the Modbus protocol. This library can use a serial port or an Ethernetconnection.

The functions included in the library have been derived from the Modicon ModbusProtocol Reference Guide which can be obtained fromwww.modbus.org.

The license of libmodbus isLGPL v2.1 or later.

The official website iswww.libmodbus.org. Thewebsite 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 (gccor clang) to compile the library and asciidoc and xmlto to generate thedocumentation (optional).

To install, just run the usual dance,./configure && make install. Run./autogen.sh first to generate theconfigure 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 isproperly set up on your system (/etc/ld.so.conf.d) and library cache is up todate (runldconfig as root if required).

The library provides alibmodbus.pc file to use withpkg-config to ease yourprogram compilation and linking.

If you want to compile with Microsoft Visual Studio, you should follow theinstructions in./src/win32/README.md.

To compile under Windows, installMinGW and MSYS thenselect the common packages (gcc, automake, libtool, etc). The directory./src/win32/ contains a Visual C project.

To compile under OS X withhomebrew, youwill 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 intests directory, you can freely edit the sourcecode to fit your needs (it's Free Software :).

Seetests/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 withmake check.

To report a bug or to contribute

SeeCONTRIBUTING document.

Documentation

You can serve the local documentation with:

pip install mkdocs-materialmkdocs serve

[8]ページ先頭

©2009-2025 Movatter.jp