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

Feature request: ability to set unit id on a request by request basis #63

Open
wz2b opened this issue Aug 13, 2020 · 3 comments
Open

Feature request: ability to set unit id on a request by request basis #63

wz2b opened this issue Aug 13, 2020 · 3 comments

Comments

@wz2b
Copy link

wz2b commented Aug 13, 2020

I have a gateway with multiple "slave" (we should rename that "unit") devices attache. Need to be able to specify slave addr per call, rather than changing the per connection SlaveID which works but raises potential concurrency problems.

@shantanoo
Copy link

shantanoo commented Feb 14, 2022

Just thinking out loud, would setting handler.rtuPackager.SlaveId / handler.SlaveId just before the operation help? https://github.com/grid-x/modbus/blob/master/rtuclient.go has SetSlave function.

@xxandev
Copy link

xxandev commented Feb 15, 2022

@pxnky
Copy link

pxnky commented Mar 25, 2023

Just thinking out loud, would setting handler.rtuPackager.SlaveId / handler.SlaveId just before the operation help? https://github.com/grid-x/modbus/blob/master/rtuclient.go has SetSlave function.

Then you have to keep the handler around through all the rest of the code. This seems like a very basic feature, I don't understand why the assumption (seems to be) that you only set it once.

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

No branches or pull requests

4 participants