From 2680b42edcec1c95545c97f40827723b0754582b Mon Sep 17 00:00:00 2001 From: bnjmnp Date: Sat, 3 Feb 2024 15:05:27 +0100 Subject: [PATCH] fix #128 missing device list clean on repeated config_init calls --- pysoem/pysoem.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pysoem/pysoem.pyx b/pysoem/pysoem.pyx index a1d4ae9..7b45b72 100644 --- a/pysoem/pysoem.pyx +++ b/pysoem/pysoem.pyx @@ -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 @@ -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):