// the find
stephane/libmodbus
A Modbus library for Linux, Mac OS, FreeBSD and Windows
libmodbus is a C library for communicating over the Modbus protocol via serial (RTU) or TCP. It covers both client and server roles and runs on Linux, Mac, FreeBSD, Windows, and even embedded targets via Embox RTOS. The target audience is industrial/automation engineers and embedded developers who need to talk to PLCs, sensors, or other Modbus devices.
Per-function man-page-style documentation for every API call is genuinely useful — no guessing at parameters. The float byte-order helpers (ABCD/BADC/CDAB/DCBA variants) address a real pain point that most Modbus implementations ignore. Coverity static analysis is wired into CI, which matters for a library used in industrial control systems. The autotools build produces a proper pkg-config file, so integrating into an existing C project is straightforward.
The autotools build chain (autogen.sh → configure → make) is friction in 2026; there is no CMake option, which means most modern embedded or cross-compilation toolchains require extra ceremony. The Windows Visual Studio project targets VS2009 (modbus-9.sln) and has not kept pace — if you are on Windows and not using MinGW, expect pain. No async or non-blocking I/O support: every call blocks, so building a responsive server that handles multiple clients simultaneously requires you to wire up your own threading or forking. The test suite tests the library against itself (unit-test-server paired with unit-test-client) rather than against a real or simulated hardware device, so edge-case protocol quirks from real PLCs are underrepresented.