2020-06-21 07:09:15 +08:00
|
|
|
.. _modbus:
|
|
|
|
|
2021-12-14 06:21:01 +08:00
|
|
|
Modbus
|
2020-06-21 07:09:15 +08:00
|
|
|
######
|
|
|
|
|
2021-04-15 20:17:34 +08:00
|
|
|
Modbus is an industrial messaging protocol. The protocol is specified
|
|
|
|
for different types of networks or buses. Zephyr OS implementation
|
|
|
|
supports communication over serial line and may be used
|
|
|
|
with different physical interfaces, like RS485 or RS232.
|
|
|
|
TCP support is not implemented directly, but there are helper functions
|
|
|
|
to realize TCP support according to the application's needs.
|
2020-06-21 07:09:15 +08:00
|
|
|
|
2021-04-15 20:17:34 +08:00
|
|
|
Modbus communication is based on client/server model.
|
|
|
|
Only one client may be present on the bus. Client can communicate with several
|
|
|
|
server devices. Server devices themselves are passive and must not send
|
|
|
|
requests or unsolicited responses.
|
|
|
|
Services requested by the client are specified by function codes (FCxx),
|
|
|
|
and can be found in the specification or documentation of the API below.
|
|
|
|
|
|
|
|
Zephyr RTOS implementation supports both client and server roles.
|
|
|
|
|
|
|
|
More information about Modbus and Modbus RTU can be found on the website
|
|
|
|
`MODBUS Protocol Specifications`_.
|
|
|
|
|
|
|
|
Samples
|
|
|
|
*******
|
|
|
|
|
2023-09-06 16:25:28 +08:00
|
|
|
* :zephyr:code-sample:`modbus-rtu-server` and :zephyr:code-sample:`modbus-rtu-client` samples give
|
|
|
|
the possibility to try out RTU server and RTU client implementation with an evaluation board.
|
|
|
|
* :zephyr:code-sample:`modbus-tcp-server` sample is a simple Modbus TCP server.
|
|
|
|
* :zephyr:code-sample:`modbus-gateway` sample shows how to build a TCP to serial line
|
|
|
|
gateway with Zephyr OS.
|
2021-04-15 20:17:34 +08:00
|
|
|
|
|
|
|
API Reference
|
|
|
|
*************
|
|
|
|
|
|
|
|
.. doxygengroup:: modbus
|
|
|
|
|
|
|
|
.. _`MODBUS Protocol Specifications`: https://www.modbus.org/specs.php
|