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

minval and maxval for float32 in simulator #1658

Closed
RyIot3329 opened this issue Jul 14, 2023 · 6 comments · Fixed by #1659 or #1671
Closed

minval and maxval for float32 in simulator #1658

RyIot3329 opened this issue Jul 14, 2023 · 6 comments · Fixed by #1659 or #1671

Comments

@RyIot3329
Copy link

Versions

  • Python: Python 3.9.2
  • OS: Debian 11
  • Pymodbus: dev

Pymodbus Specific

  • Server: tcp - Simulator

Description

I have this defined in my json file for the simulator.

    {
      "addr": [7, 8],
      "value": 72.0,
      "action": "random",
      "kwargs": { "minval": 65.0, "maxval": 78.0 }
    }

It does not seem to follow the minval and maxval values from what I can see. I am getting random Float values, so that works. But it isn't in between the bounds. Any ideas?

@janiversen
Copy link
Collaborator

datastore/simulator.py#633 it seems to do what it is supposed to do.

I need to check it.

@janiversen
Copy link
Collaborator

I see it's not covered in our test suite, I will add a specific test and see what happens.

@janiversen
Copy link
Collaborator

janiversen commented Jul 15, 2023

I have now added a test case, and as far as I can see everything works as it should.

Did you make the configuration within the "float32" label ?

I added your values just to test. The test case retrieves 100 values and all are between minval and maxval.

If you need further help, please add the pymodbus debug log, as the issue template asked you to do.

@RyIot3329
Copy link
Author

Yeah I added it within the "float" block. Would it help to upload the entire json file?

@janiversen
Copy link
Collaborator

No, a debug log would help.

@RyIot3329
Copy link
Author

Sorry for the delay on this. Here is the log file and the JSON file I am using
log.txt
tstat.txt

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants