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

Web simulator documentation and examples missing. #1284

Open
janiversen opened this issue Jan 24, 2023 · 6 comments
Open

Web simulator documentation and examples missing. #1284

janiversen opened this issue Jan 24, 2023 · 6 comments

Comments

@janiversen
Copy link
Collaborator

janiversen commented Jan 24, 2023

The new web simulator misses some features, before being the main simulator:

  • ReST API
  • Documentation
  • trace of calls.

Documentation of config done !
Documentation of web pages waits until (someone) the have a better look.
Documentation of http_server and main can be done.

@janiversen janiversen modified the milestones: Version 3.2, Version 3.3 Jan 24, 2023
@janiversen janiversen modified the milestones: Version 3.3, Version 3.4 Mar 14, 2023
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@alexrudd2 alexrudd2 modified the milestones: Version 3.4, Version 3.5, Version 3.6 Sep 7, 2023
pnl-jseb added a commit to pnl-jseb/pymodbus that referenced this issue May 22, 2024
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 added a commit to pnl-jseb/pymodbus that referenced this issue May 22, 2024
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 added a commit to pnl-jseb/pymodbus that referenced this issue May 22, 2024
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
	- Performed linting on 3.12

Resolves [discussion]: pymodbus-dev#1458
Partially addresses: pymodbus-dev#1284
pnl-jseb added a commit to pnl-jseb/pymodbus that referenced this issue May 22, 2024
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
	- Performed linting on 3.12

Resolves [discussion]: pymodbus-dev#1458
Partially addresses: pymodbus-dev#1284
pnl-jseb added a commit to pnl-jseb/pymodbus that referenced this issue May 22, 2024
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
	- Performed linting on 3.12

Resolves [discussion]: pymodbus-dev#1458
Partially addresses: pymodbus-dev#1284
@janiversen janiversen removed this from the Version 3.6 milestone Jul 21, 2024
@efdx
Copy link
Contributor

efdx commented Jul 29, 2024

Hello,

I am currently contemplating on possibilities for automating use of the client. The ReST-API would be a convenience for me, and I could possibly create a skeleton for the build_json_* functions based on their html equivalents. But what kind of state would you expect for it at this point? At best, they would be filled, but I don't think I have the know-how/time to set up full integration tests for whatever I would do, much less fully document it.

So in short: if anything is done, what is the expected outcome?

@janiversen
Copy link
Collaborator Author

janiversen commented Jul 29, 2024

I am not sure how you can make a rest api without fully integrating it.

This might b3 easier if you submit a pull request, allowing us to review it.

Ps. the pull request do not need to be "everything" but enough that we can see the direction is sound.

@janiversen
Copy link
Collaborator Author

Documentation is of course important, without it the feature is unknown, however writing documentation is easier than programming skeletons, just have a look in docs

@efdx
Copy link
Contributor

efdx commented Jul 29, 2024

I am not sure how you can make a rest api without fully integrating it.

Yeah true, I guess it could not be called that :D What I meant is that if I take build_html_registers and convert on build_json_registers (more or less copy-paste + adapt at this point), I would get enough to manipulate registers with json format API. This indeed would not be a full API in any sense. Plus as said, I don't know enough of the features included in build_html_registers (mainly operations, Set, Clear, Stop, etc) to validate if they function properly or not. Due to these, I'd still call it a skeleton at best.

Same would apply for the other json endpoints.

If I had time, I do have plans on how to implement it completely. Sadly, I'm lacking on the extra-time department :/

Documentation is of course important

Of course. But in my case, the same skeleton principle would apply. It would only be something like

ReST API Title
==============

Note. This is still a work in progress. Here is the current description of calls supported at the moment.

<insert-content-here>

But regardless. I'll see what I can do about the PR. No promises though.

@janiversen
Copy link
Collaborator Author

Thinking about combining server and simulator so that the simulator will only be a http server using the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants