ingeniamc / ingenialink-python

Communication library for Ingenia servo drives
Other
17 stars 7 forks source link

Examples don't run #269

Open Vasserman292992 opened 1 year ago

Vasserman292992 commented 1 year ago
       Good afternoon, I'm trying to run the examples/ethercat/ example ecat_connection.py, but I'm having some problems. I use the EVEREST XCR-E board and connect to it via the EtherCAT protocol. The device, as I understand it, is detected, but the following error occurs:

PS C:\Users\a.danilin\Desktop\INGA\ingenialink-python > & C:/Users/a.danilin/AppData/Local/Programs/Python/y [1] 1.7.2.000 11:58:21 WARN C:\Users\ContainerAdministrator\ingenialink-python_deps\ingenialink\ingenialink\ecat\net.c:1991: Slave 0 cannot enter into state INIT. I tried to run all the examples sequentially from the examples folder, but the following errors occur: 1) WARN C:....\ingenialink\ingenialink\ecat\net.c:1991: Slave 0 cannot enter into state INIT.. 2) WARN C:\ingenialink-python_deps\ingenialink\ingenialink\ecat\net.c12:00:00 WARN 3) ImportError: cannot import name 'NET_TRANS_PROT' from 'ingenialink.ethernet.network' Please tell me what this may be related to and how to fix these errors. If possible, please send detailed instructions on how to build the library and run examples from it. Information about my system:

MartinALL91 commented 1 year ago

Hi @Vasserman292992 ,

All of the examples are working. Be sure to configure the correct interface name and dictionary path.

1) WARN C:....\ingenialink\ingenialink\ecat\net.c:1991: Slave 0 cannot enter into state INIT.. 2) WARN C:\ingenialink-python_deps\ingenialink\ingenialink\ecat\net.c12:00:00 WARN These two messages are warnings, not errors. This is normal behavior.

3) ImportError: cannot import name 'NET_TRANS_PROT' from 'ingenialink.ethernet.network' This is due to an error with the script. It can be solved by simply removing this line.

There is no need to build the library. Install the library with the following command: pip install ingenialink

Once you have the library installed, run an example: python examples/ethercat/ecat_connection.py