bnjmnp / pysoem

Cython wrapper for the Simple Open EtherCAT Master Library
MIT License
95 stars 36 forks source link

config_init append slaves to CdefMaster slaves attribute, but never clean it #128

Closed GullinBustin closed 5 months ago

GullinBustin commented 5 months ago

CdefMaster slaves is initialized to an empty list on the CdefMaster constructor. In config_init each slave is appended to slaves. If a new slave is added physically to the network and config_init is called again, old slaves have been added again to the slaves list. It can be fixed by cleaning the slaves list before append slaves.

https://github.com/bnjmnp/pysoem/blob/23ef331bdf30307bb778c1f65b7125b104edad08/pysoem/pysoem.pyx#L229-L242

bnjmnp commented 5 months ago

Thank you for pointing this out. Totally makes sense to have this fixed.