ingeniamc / ingeniamotion

Motion library for Ingenia servo drives
Other
6 stars 0 forks source link

INGM-464 Delete network from dictionary if connection is not successful #199

Closed MartinALL91 closed 2 months ago

MartinALL91 commented 3 months ago

Description

If a connection to a drive fails, the Network instance remains in the network dictionary. Remove it from the network dictionary if no other drives are connected to it.

Fixes # INGM-464

Type of change

Tests

Code formatting

Others

polfeliu commented 3 months ago

I don't understand how this relates to the original issue, I may be missing on some context

MartinALL91 commented 3 months ago

I don't understand how this relates to the original issue, I may be missing on some context

When trying to connect to an EtherCAT device (via CoE or EoE) the network instance was stored even if the connection failed. So when trying to connect to the same device but with a different protocol the previous network instance was being used. This caused an exception due to the difference in the arguments in the connect_to_slave method.

polfeliu commented 3 months ago

I don't understand how this relates to the original issue, I may be missing on some context

When trying to connect to an EtherCAT device (via CoE or EoE) the network instance was stored even if the connection failed. So when trying to connect to the same device but with a different protocol the previous network instance was being used. This caused an exception due to the difference in the arguments in the connect_to_slave method.

What if you connect to one CoE device succesfully, and then fail to connect to a second CoE device? Will the network be destroyed?

MartinALL91 commented 3 months ago

I don't understand how this relates to the original issue, I may be missing on some context

When trying to connect to an EtherCAT device (via CoE or EoE) the network instance was stored even if the connection failed. So when trying to connect to the same device but with a different protocol the previous network instance was being used. This caused an exception due to the difference in the arguments in the connect_to_slave method.

What if you connect to one CoE device succesfully, and then fail to connect to a second CoE device? Will the network be destroyed?

It will not be destroyed. It is only removed if the network has no servos connected to it.