Skip to content
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

Modbus simulator - Added support for additional datatypes #2201

Closed
wants to merge 1 commit into from

Conversation

pnl-jseb
Copy link

This update adds native support for some of the most commonly found datatypes in OT systems. This includes support for bitfields, unsigned integers, signed integers, and floating point numbers in multiple word sizes (16 bit, 32 bit and 64 bit).

Relevant changes include:
A reworked version of simulator.py that relies on struct.unpack, struct.pack, and other native functions to simplifly datatype handling while also incorportating additional checks to ensure the register layout behaves as expected.
In order to simplifly future work development, the Bits field has been renamed bitfield16, while also adding support for 32 and 64 bit fields. To help facilitate adoption, several changes have been done to the project files to ensure a smooth transition. This includes:
- Updated documentation to reflect new datatypes, including examples.
- Updated unit tests, to ensure the code works as expected.
- Updated the simulator example to illustrate how the new datatypes can be used

Resolves [discussion]: #1458
Partially addresses: #1284

This update adds native support for some of the most commonly found
datatypes in OT systems. This includes support for bitfields, unsigned
integers, signed integers, and floating point numbers in multiple word
sizes (16 bit, 32 bit and 64 bit).

Relevant changes include:
A reworked version of simulator.py  that relies on struct.unpack,
struct.pack, and other native functions to simplifly datatype handling
while also incorportating additional checks to ensure the register layout
behaves as expected.
In order to simplifly future work development, the Bits field has been
renamed bitfield16, while also adding support for 32 and 64 bit fields.
To help facilitate adoption, several changes have been done to the project
files to ensure a smooth transition. This includes:
	- Updated documentation to reflect new datatypes, including examples.
	- Updated unit tests, to ensure the code works as expected.
	- Updated the simulator example to illustrate how the new datatypes
	  can be used

Resolves [discussion]: pymodbus-dev#1458
Partially addresses: pymodbus-dev#1284
@pnl-jseb pnl-jseb marked this pull request as draft May 22, 2024 03:41
@pnl-jseb pnl-jseb marked this pull request as ready for review May 22, 2024 03:45
@pnl-jseb pnl-jseb closed this May 22, 2024
@janiversen
Copy link
Collaborator

This is a very big PR, which will be very hard to review ! splitting it into a number of smaller PRs is needed.

This smaller PR are needed not only for review but also for regression testing.

The rename of bitfield to bitfield16 ... is illogical since a bit field can be anything from 1bit to 10of thousands,

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.

2 participants