Network¶
-
class
ingenialink.ethernet.network.
EthernetNetwork
[source]¶ Network for all Ethernet communications.
-
close_socket
()¶ Closes the established network socket.
-
connect_to_slave
(target, dictionary=None, port=1061, communication_protocol=<NET_TRANS_PROT.UDP: 2>)[source]¶ Connects to a slave through the given network settings.
- Parameters
target (str) – IP of the target slave.
dictionary (str) – Path to the target dictionary file.
port (int) – Port to connect to the slave.
communication_protocol (NET_TRANS_PROT) – Communication protocol, UPD or TCP.
- Returns
Instance of the servo connected.
- 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.
-
static
load_firmware
(fw_file, target='192.168.2.22', ftp_user='', ftp_pwd='')[source]¶ Loads a given firmware file to the target slave.
- Parameters
fw_file (str) – Path to the firmware file to be loaded.
target (str) – IP of the target slave.
ftp_user (str) – FTP user to connect with.
ftp_pwd (str) – FTP password for the given user.
- Raises
ILError – If the loading firmware process fails.
-
static
load_firmware_moco
(node, subnode, ip, port, moco_file)[source]¶ Update MOCO firmware through UDP protocol.
- Parameters
node – Network node.
subnode – Drive subnode.
ip – Drive address IP.
port – Drive port.
moco_file – Path to the firmware file.
- Returns
Result code.
- Return type
int
- Raises
ILFirmwareLoadError – The firmware load process fails
with an error message. –
-
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) –
-
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
-