Skip to content

Commit

Permalink
fix #128 missing device list clean on repeated config_init calls
Browse files Browse the repository at this point in the history
  • Loading branch information
bnjmnp committed Feb 3, 2024
1 parent b37e2bd commit 2680b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pysoem/pysoem.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ cdef class CdefMaster:
self._ecx_contextt.FOEhook = NULL
self._ecx_contextt.manualstatechange = 0

self.slaves = []
self.slaves = None
self.sdo_read_timeout = 700000
self.sdo_write_timeout = 700000
self._settings.sdo_read_timeout = &self.sdo_read_timeout
Expand Down Expand Up @@ -235,6 +235,7 @@ cdef class CdefMaster:
Returns:
int: Working counter of slave discover datagram = number of slaves found, -1 when no slave is connected
"""
self.slaves = []
ret_val = cpysoem.ecx_config_init(&self._ecx_contextt, usetable)
if ret_val > 0:
for i in range(self._ec_slavecount):
Expand Down

0 comments on commit 2680b42

Please sign in to comment.