Skip to content

Value limits accepted by Slave on the Holding Register (HREGS) #69

Open
@beyonlo

Description

@beyonlo

Description

Is there a way to set what are the values allowed and/or min and max values allowed on the Slave?

"HREGS": {
    "EXAMPLE_HREG": {
        "register": 93,
        "len": 9,
        "val": [1, 38, 0, 1600, 2150, 5067, 2564, 8450, 3456]
    }

Example 1:
The address 93 is number 29. I would like that address accept just min value 1 and max value 8

Example 2:
The address 96 is number 1600. I would like that address accept just one of this list [1600, 2100, 2300, 5000, 132, 8003]

So, if ModBus Master try to set a different value than that allowed, will be not accepted by the Slave, and an error will be returned to the Master.

Is possible to do that or something similar?

Thank you!

Reproduction steps

...

MicroPython version

1.19.1

MicroPython board

ESP32

MicroPython Modbus version

2.4.0rc62.dev56

Relevant log output

No response

User code

No response

Additional informations

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions