sourceperl / pyModbusTCP

A simple Modbus/TCP library for Python
MIT License
307 stars 106 forks source link

Support for 32-bit/64-bit registers reading #65

Closed vicosystems closed 1 year ago

vicosystems commented 1 year ago

Changes

Added a third parameter in read_holding_registers() and read_input_registers() function that enable the reading of 32-bit and 64-bit registers. The reg_format parameter must be used to specify the data format inside the registers to read. Allowed arguments are f (float), h (short), H (unsigned short), i (integer), I (unsigned integer), l (long), L (unsigned long), q (long long), Q (unsigned long long).

Tests

The unit test associated was passed (tested the H register format). The function also passed the test with a real device* (H and f register formats).

*real device: Lumel ND10 with Protoss PE11

Notes

We tried to add a 32-bit/64-bit writing support but the result was negative.

sourceperl commented 1 year ago

Hi, thanks for your contribution.

But as detailed in issue #17, i prefer not to include the data handling process directly in the pyModbusTCP client.