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

Device address BSMP #12

Open
pnallin opened this issue Jan 14, 2022 · 2 comments
Open

Device address BSMP #12

pnallin opened this issue Jan 14, 2022 · 2 comments

Comments

@pnallin
Copy link
Contributor

pnallin commented Jan 14, 2022

https://github.com/lnls-sirius/pydrs/blob/4e44cf0272fcf0020139a6c176a708b4642a644a/src/pydrs/pydrs.py#L3010

In this function, when no com_add is specified (and it is set before using SetSlaveAddr), readings is always from address=1.
Should it work like this?

We propose to change it:
When no com_add is passed, function should use previous slave address. Does it make sense?

(I didnt create a PR because I have no writing access to this repo!)

@pnallin
Copy link
Contributor Author

pnallin commented Jan 14, 2022

(@MarceloGMartins @anacso17 @xresende @carneirofc)

@gabrielbrunheira
Copy link
Contributor

gabrielbrunheira commented Jan 21, 2022

Thank you for your suggestion, Pati! I would suggest to actually remove all "com_add" arguments from all functions of type "read_vars_model", as well as the related code inside the functions that set the address.

It makes the code much cleaner to understand and use when you force the execution of the function set_slave_address() (which, by the way, could be renamed to "set_serial_address" due to the potentially offensive term used) before reading variables from a specific device.

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

2 participants