Skip to content

feat(modbus_controller): Add courtesy response configuration for Modbus Server #5199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions components/modbus_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@ Configuration variables:

- **max_cmd_retries** (*Optional*, integer): How many times a command will be retried if no response is received. It doesn't include the initial transmition. Defaults to 4.

- **server_courtesy_response** (*Optional*): Configuration block to enable the courtesy response feature when the device is acting as a Modbus server.

- **enabled** (*Optional*, boolean): Whether to enable the courtesy response feature.
Defaults to ``false``.
- **register_last_address** (*Optional*, integer): The highest Modbus register address (inclusive) up to which undefined registers are allowed to be read and will be padded with a default value.
Any read request that includes undefined registers within this range will return the value specified by ``register_value`` instead of triggering an exception.
Defaults to ``65535``
- **register_value** (*Optional*, integer): The 16-bit value (range: 0–65535) to return for undefined registers within the address range defined by ``register_last_address``.
Defaults to ``0``.

- **server_registers** (*Optional*): A list of registers that are responded to when acting as a server.

- **address** (**Required**, integer): start address of the first register in a range
- **value_type** (*Optional*): datatype of the mod_bus register data. The default data type for ModBUS is a 16 bit integer in **big endian** format (network byte order, MSB first)

Expand Down