You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
e6b71a8 (which is the tip of master at the time of writing)
Description
The libmodbus documentation does not specify how one can obtain information about Modbus exception codes returned by a server upon a failed read or write operation.
Actual behavior if applicable
By reading the source code, I've discovered that libmodbus does in fact set errno to codes corresponding to the Modbus exception codes, such as EMBXILFUN etc. However, as far as I can tell, this is not mentioned anywhere in the reference documentation. For example, the reference page for modbus_read_registers() lists EMBMDATA as the only error code (which is an internal libmodbus error and not a Modbus exception).
Expected behavior or suggestion
Ideally, each function reference page should list all possible errno values, or at least the non-standard ones.
At minimum, the Error handling section of the front page should describe in general terms how Modbus exception codes are handled, what the corresponding constants are called, and which functions may return them.
The text was updated successfully, but these errors were encountered:
kyllingstad
changed the title
Missing documentation of errno value corresponding to Modbus exception codes
Missing documentation of errno values corresponding to Modbus exception codes
Jan 5, 2024
libmodbus version
e6b71a8 (which is the tip of
master
at the time of writing)Description
The libmodbus documentation does not specify how one can obtain information about Modbus exception codes returned by a server upon a failed read or write operation.
Actual behavior if applicable
By reading the source code, I've discovered that libmodbus does in fact set
errno
to codes corresponding to the Modbus exception codes, such asEMBXILFUN
etc. However, as far as I can tell, this is not mentioned anywhere in the reference documentation. For example, the reference page formodbus_read_registers()
listsEMBMDATA
as the only error code (which is an internal libmodbus error and not a Modbus exception).Expected behavior or suggestion
Ideally, each function reference page should list all possible
errno
values, or at least the non-standard ones.At minimum, the Error handling section of the front page should describe in general terms how Modbus exception codes are handled, what the corresponding constants are called, and which functions may return them.
The text was updated successfully, but these errors were encountered: