cnpem-emi / pydrs

Python library for interfacing with current power supplies and related peripherals
MIT License
0 stars 1 forks source link

Device address BSMP #12

Open pnallin opened 2 years ago

pnallin commented 2 years ago

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 commented 2 years ago

(@MarceloGMartins @anacso17 @xresende @carneirofc)

gabrielbrunheira commented 2 years ago

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.