Network¶
-
class
ingenialink.eoe.network.EoENetwork(ifname, connection_timeout=1)[source]¶ Network for EoE (Ethernet over EtherCAT) communication.
- Parameters
ifname (str) – Network interface name.
connection_timeout (float) – Time in seconds of the connection timeout
the EoE service. (to) –
-
static
close_socket(sock)¶ Closes the established network socket.
-
connect_to_slave(slave_id, ip_address, dictionary=None, port=1061, connection_timeout=1, servo_status_listener=False, net_status_listener=False)[source]¶ Connects to a slave through the given network settings.
- Parameters
slave_id (int) – EtherCAT slave ID.
ip_address (str) – IP address to be assigned to the slave.
dictionary (str) – Path to the target dictionary file.
port (int) – Port to connect to the slave.
connection_timeout (float) – Time in seconds of the connection timeout.
servo_status_listener (bool) – Toggle the listener of the servo for its status, errors, faults, etc.
net_status_listener (bool) – Toggle the listener of the network status, connection and disconnection.
- Raises
- Returns
Instance of the servo connected.
- Return type
EthernetServo
-
disconnect_from_slave(servo)[source]¶ Disconnects the slave from the network.
- Parameters
servo (EthernetServo) – Instance of the servo connected.
-
scan_slaves()[source]¶ Scan slaves connected to the network adapter.
- Returns
List containing the ids of the connected slaves.
- Return type
list
- Raises
ILError – If the EoE service fails to perform a scan.
-
start_status_listener()¶ Start monitoring network events (CONNECTION/DISCONNECTION).
-
stop_status_listener()¶ Stops the NetStatusListener from listening to the drive.
-
subscribe_to_status(ip, callback)¶ Subscribe to network state changes.
- Parameters
ip (str) – IP of the drive to subscribe.
callback (function) – Callback function.
-
unsubscribe_from_status(ip, callback)¶ Unsubscribe from network state changes.
- Parameters
ip (str) – IP of the drive to unsubscribe.
callback (function) – Callback function.
-
servos¶ List of the connected servos in the network.
- Type
list