Network¶
- class ingenialink.net.EEPROM_TOOL_MODE(value)[source]¶
EEPROM tool mode.
- MODE_INFO = 6¶
Information.
- MODE_NONE = 0¶
None.
- MODE_READBIN = 1¶
Read Binary.
- MODE_READINTEL = 2¶
Read Intelhex.
- MODE_WRITEALIAS = 5¶
Write Alias.
- MODE_WRITEBIN = 3¶
Write Binary.
- MODE_WRITEINTEL = 4¶
Write Intelhex.
- class ingenialink.net.NET_DEV_EVT(value)[source]¶
Device Event.
- ADDED = 0¶
Added.
- REMOVED = 1¶
Event.
- class ingenialink.net.NET_PROT(value)[source]¶
Network Protocol.
- CAN = 5¶
CAN.
- ECAT = 3¶
ECAT.
- ETH = 2¶
ETH.
- EUSB = 0¶
E-USB.
- MCB = 1¶
MCB.
- class ingenialink.net.NET_STATE(value)[source]¶
Network State.
- CONNECTED = 0¶
Connected.
- DISCONNECTED = 1¶
Disconnected.
- FAULTY = 2¶
Faulty.
- class ingenialink.net.Network(prot, port=None, slave=1, timeout_rd=0.5, timeout_wr=0.5)[source]¶
Network.
- Parameters
prot (NET_PROT) – Protocol.
port (str) – Network device port (e.g. COM1, /dev/ttyACM0, etc.).
timeout_rd (int, float, optional) – Read timeout (s).
timeout_wr (int, float, optional) – Write timeout (s).
- Raises
TypeError – If the protocol type is invalid.
ILCreationError – If the network cannot be created.
- disturbance_channel_data(channel, dtype, data_arr)[source]¶
Send disturbance data.
- Parameters
channel (int) – Identity channel number.
dtype (REG_DTYPE) – Data type of the register mapped.
data_arr (array) – Data that will be sent to the drive.
- Returns
Return code.
- Return type
int
- property disturbance_data¶
Obtain disturbance data.
- Returns
Current disturbance data.
- Return type
array
- property disturbance_data_size¶
Obtain disturbance data size.
- Returns
Current disturbance data size.
- Return type
int
- disturbance_remove_all_mapped_registers()[source]¶
Remove all disturbance mapped registers.
- Returns
Return code.
- Return type
int
- disturbance_set_mapped_register(channel, address, dtype)[source]¶
Set disturbance mapped register.
- Parameters
channel (int) – Identity channel number.
address (int) – Register address to map.
dtype (REG_DTYPE) – Data type of the register to map.
- Returns
Return code.
- Return type
int
- property extended_buffer¶
Obtain extended buffer data.
- Returns
Current extended buffer data.
- Return type
str
- master_startup(ifname, if_address_ip)[source]¶
Start SOEM master.
- Parameters
ifname (str) – Interface name.
if_address_ip (str) – Interface address IP.
- Returns
Result code.
- Return type
int
- monitoring_channel_data(channel, dtype)[source]¶
Obtain processed monitoring data of a channel.
- Parameters
channel (int) – Identity channel number.
dtype (REG_DTYPE) – Data type of the register to map.
- Returns
Monitoring data.
- Return type
array
- property monitoring_data¶
Obtain monitoring data.
- Returns
Current monitoring data.
- Return type
array
- property monitoring_data_size¶
Obtain monitoring data size.
- Returns
Current monitoring data size.
- Return type
int
- monitoring_get_bytes_per_block()[source]¶
Obtain Bytes x Block configured.
- Returns
Actual number of Bytes x Block configured.
- Return type
int
- monitoring_get_num_mapped_registers()[source]¶
Obtain the number of mapped registers.
- Returns
Actual number of mapped registers.
- Return type
int
- monitoring_read_data()[source]¶
Obtain processed monitoring data.
- Returns
Actual processed monitoring data.
- Return type
array
- monitoring_remove_all_mapped_registers()[source]¶
Remove all monitoring mapped registers.
- Returns
Result code.
- Return type
int
- monitoring_set_mapped_register(channel, reg_idx, dtype)[source]¶
Set monitoring mapped register.
- Parameters
channel (int) – Identity channel number.
reg_idx (int) – Register address to map.
dtype (REG_DTYPE) – Data type of the register to map.
- Returns
Result code.
- Return type
int
- net_mon_status(on_evt)[source]¶
Calls given function everytime a connection/disconnection event is raised.
- Parameters
on_evt (Callback) – Function that will be called every time an event is raised.
- property port¶
Obtain network port.
- Returns
Current network port.
- Return type
str
- property prot¶
Obtain network protocol.
- Returns
Current network protocol used.
- Return type
str
- read_sdo(idx, subidx, dtype, slave=1)[source]¶
Read SDO from network.
- Parameters
idx (int) – Register index.
subidx (int) – Register subindex.
dtype (REG_DTYPE) – Register data type.
slave (int, Optional) – Identifier of an slave in the network.
- Returns
Obtained value
- Return type
float
- Raises
TypeError – If the register type is not valid.
- read_string_sdo(idx, subidx, size, slave=1)[source]¶
Read string SDO from network.
- Parameters
idx (int) – Register index.
subidx (int) – Register subindex.
size (int) – Size in bytes to read.
slave (int, Optional) – Identifier of an slave in the network.
- Returns
Obtained value
- Return type
str
- Raises
TypeError – If the register type is not valid.
- servos(on_found=None)[source]¶
Obtain a list of attached servos.
- Parameters
on_found (callback, optional) – Servo found callback.
- Returns
List of attached servos.
- Return type
list
- set_if_params(ifname, if_address_ip)[source]¶
Set ethernet interface parameters.
- Parameters
ifname (str) – Interface name.
if_address_ip (str) – Interface address IP.
Returns:
- set_reconnection_retries(retries)[source]¶
Set the number of reconnection retries in our application.
- Parameters
retries (int) – Number of reconnection retries.
- set_recv_timeout(timeout)[source]¶
Set receive communications timeout.
- Parameters
timeout (int) – Timeout in ms.
- Returns
Result code.
- Return type
int
- set_status_check_stop(stop)[source]¶
Start/Stop the internal monitor of the drive status.
- Parameters
stop (int) – 0 to START, 1 to STOP.
- Returns
Result code.
- Return type
int
- property state¶
Obtain network state.
- Returns
Current network state.
- Return type
str
- property status¶
Obtain network status.
- Returns
Current network status.
- Return type
str
- write_sdo(idx, subidx, dtype, value, slave=1)[source]¶
Write SDO from network.
- Parameters
idx (int) – Register index.
subidx (int) – Register subindex.
dtype (REG_DTYPE) – Register data type.
value (float) – Value to write.
slave (int, Optional) – Identifier of an slave in the network.
- Returns
Obtained value
- Return type
float
- Raises
TypeError – If the register type is not valid.
- class ingenialink.net.NetworkMonitor(prot)[source]¶
Network Monitor.
- Parameters
prot (NET_PROT) – Protocol.
- Raises
TypeError – If the protocol type is invalid.
ILCreationError – If the monitor cannot be created.
- ingenialink.net.devices(prot)[source]¶
Obtain a list of network devices.
- Parameters
prot (NET_PROT) – Protocol.
- Returns
List of network devices.
- Return type
list
- Raises
TypeError – If the protocol type is invalid.
- ingenialink.net.eeprom_tool(ifname, mode, filename)[source]¶
Tool to modify and verify drive EEPROM.
- Parameters
ifname (str) – Interface name.
mode (int) – EEPROM tool mode.
filename (str) – Path to the EEPROM file.
- Returns
Result code.
- Return type
int
- ingenialink.net.force_error(ifname, if_address_ip)[source]¶
Force state machine error.
- Parameters
ifname – Interface name.
if_address_ip – Interface address IP.
- Returns
Result code.
- Return type
int
- ingenialink.net.master_startup(ifname, if_address_ip)[source]¶
Start SOEM master.
- Parameters
ifname (str) – Interface name.
if_address_ip (str) – Interface address IP.
- Returns
Result code.
- Return type
int
- ingenialink.net.update_firmware(ifname, filename, is_summit=False, slave=1)[source]¶
Update firmware through FoE.
- Parameters
ifname – Interface name.
filename – Path to the firmware file.
is_summit – [true] -> Everest [false] -> Capitan or Low-Power drives
slave – Slave number in the network.
- Returns
Result code.
- Return type
int