Skip to content

How to send a non-standard function code #86

@larrybarello

Description

@larrybarello

For a particular vendor, a custom function code ($78) with a payload of 0x0000, 0x0001, causes a reset to factory defaults. The response appears to be an echo of the request.

Is this possible without modifying minimalmodbus code?

i'm a newbie and attempted a subclass, and ran into trouble pretty quick when making a stripped down "read" method that just jammed in the values.

Could a generic write be exposed and allow the user jam in OEM functions? Or maybe a magic method that overrides the function code on the next transaction? Then the user can pick the closest transaction, override the function code. In my case "read_register(0)" and poke in the $78 This is an ugly solution, but presumably the user would know what they are doing if they tried it.

edit: this particular vendor also uses 0xFF as the broadcast address :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    UsageUsage questions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions