Skip to content

Enhance modbus-write for 32-bit values and byte order support#14

Merged
ashaffah merged 2 commits into
mainfrom
feat/modbus-write-multiple
Jun 29, 2026
Merged

Enhance modbus-write for 32-bit values and byte order support#14
ashaffah merged 2 commits into
mainfrom
feat/modbus-write-multiple

Conversation

@ashaffah

Copy link
Copy Markdown
Owner

This pull request extends the Modbus write node to support writing 32-bit floating point and unsigned integer values (over two registers) with configurable byte and word order. It also improves payload handling and adds comprehensive tests for the new functionality.

Modbus Write Node Enhancements:

  • Added support for writing 32-bit float (float32) and unsigned integer (uint32) values, with configurable byte and word order, in addition to the existing single register/coil writes. [1] [2]
  • Expanded the configuration schema in catalog() to include new function options (float32, uint32) and a byte_order setting, which is shown only for 32-bit writes.

Payload Handling Improvements:

  • Updated payload parsing to handle floating-point values and numeric strings more robustly, replacing the previous integer-only approach.

Testing and Documentation:

  • Added unit tests to verify all byte/word order combinations, encoding/decoding correctness, and payload parsing for the new Modbus write functionality.
  • Updated documentation in both English and Indonesian to reflect the new Modbus write capabilities and configuration options. [1] [2]

ashaffah added 2 commits June 29, 2026 10:37
modbus-write only did single register/coil, so 32-bit setpoints
(write_multiple_registers in PLC mappings) could not be expressed. Add
function options `float32` and `uint32` that encode the numeric payload
into two registers per `byte_order` (big_big / big_little) and write them
with write_multiple_registers. Expose the options + byte_order in the
catalog. Unit-test the register split and float round-trip.
big_big alone was not enough: byte_order is <bytes-in-register>_<word-order>,
so little_big / little_little also swap the two bytes inside each register.
Handle all four in split_u32 (and document them), expand the catalog
options, and round-trip-test every order.
@ashaffah ashaffah merged commit 0e2f322 into main Jun 29, 2026
1 check passed
@ashaffah ashaffah deleted the feat/modbus-write-multiple branch July 1, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant