Network¶
-
class
ingenialink.ethercat.network.
EthercatNetwork
(interface_name='')[source]¶ Network for all EtherCAT communications.
- Parameters
interface_name (str) – Interface name to be targeted.
-
close_socket
()¶ Closes the established network socket.
-
connect_to_slave
(target=1, dictionary='', use_eoe_comms=1)[source]¶ Connect a slave through an EtherCAT connection.
- Parameters
target (int) – Number of the target slave.
dictionary (str) – Path to the dictionary to be loaded.
use_eoe_comms (int) – Specify which architecture is the target based on.
- Returns
Instance of the connected servo.
- Return type
-
destroy_network
()¶ Destroy network instance.
-
disconnect_from_slave
(servo)[source]¶ Disconnects the slave from the network.
- Parameters
servo (EthernetServo) – Instance of the servo connected.
-
load_firmware
(fw_file, target=1, boot_in_app=True)[source]¶ Loads a given firmware file to a target.
Warning
Choose the
boot_in_app
flag accordingly to your servo specifications otherwise the servo could enter a blocking state.- Parameters
target (int) – Targeted node ID to be loaded.
fw_file (str) – Path to the firmware file.
boot_in_app (bool) – If summit series -> True. If capitan series -> False. If custom device -> Contact manufacturer.
- Raises
ILFirmwareLoadError – The firmware load process fails
with an error message. –
-
scan_slaves
()[source]¶ Scan all the slaves connected in the network.
- Returns
List of number of slaves connected to the network.
- Return type
list
-
set_reconnection_retries
(retries)¶ Set the number of reconnection retries in our application.
- Parameters
retries (int) – Number of reconnection retries.
-
set_recv_timeout
(timeout)¶ Set receive communications timeout.
- Parameters
timeout (int) – Timeout in ms.
- Returns
Result code.
- Return type
int
-
set_status_check_stop
(stop)¶ Start/Stop the internal monitor of the drive status.
- Parameters
stop (int) – 0 to START, 1 to STOP.
- Returns
Result code.
- Return type
int
-
stop_network_monitor
()¶ Stop monitoring network events.
-
subscribe_to_status
(callback)¶ Calls given function everytime a connection/disconnection event is raised.
- Parameters
callback (Callback) – Function that will be called every time an event
raised. (is) –
-
interface_name
¶ Interface name used in the network settings.
- Type
str
-
servos
¶ List of the connected servos in the network.
- Type
list
-
property
state
¶ Obtain network state.
- Returns
Current network state.
- Return type
str
-
property
status
¶ Obtain network status.
- Returns
Current network status.
- Return type
str