bnjmnp / pysoem

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

Script crashes when Python debugger inspects `CdefSlave` #138

Open RobertoRoos opened 2 months ago

RobertoRoos commented 2 months ago

In the following code, my program crashes almost instantly when I use PyCharm debugger to view entries the slaves variable:

import pysoem
master = pysoem.Master()
master.open("\\Device\\NPF_{...}")

if master.config_init() > 0:
    slaves = master.slaves
else:
    print('no device found')

master.close()

Breaking on the last line is fine:

image

But when I try to expand slaves[0] to view its properties it crashes, with the error

Process finished with exit code -1073741819 (0xC0000005)

Otherwise the code seems okay. Adding this for example prints the names as expected:

    for slave in master.slaves:
        print(slave.name)

EDIT: Exact same happens in VS Code.