Network

class ingenialink.eoe.network.EoECommand(value)[source]

An enumeration.

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
  • ValueError – ip_address must be a subnetwork of 192.168.3.0/24

  • ILError – If the EoE service is not running.

  • ILError – If the EoE service cannot be started on the network interface.

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.

property protocol

Obtain network protocol.

Type

NET_PROT

servos

List of the connected servos in the network.

Type

list