Communication¶
-
class
ingeniamotion.communication.
Communication
(motion_controller)¶ Communication.
-
class
Protocol
(value)¶ Communication protocol enum
-
boot_mode
(servo='default')¶ Set servo to boot mode. Servo is disconnected.
- Parameters
servo (str) – servo alias to reference it.
default
by default.
-
boot_mode_and_load_firmware_ethernet
(fw_file, servo='default', ftp_user=None, ftp_pwd=None)¶ Set servo to boot mode and load firmware. Servo is disconnected.
Warning
After functions ends, the servo will take a moment to load firmware. During the process, the servo will be not operative.
-
connect_servo_canopen
(can_device, dict_path, eds_file, node_id, baudrate=<CAN_BAUDRATE.Baudrate_1M: 1000000>, channel=0, alias='default')¶ Connect to target servo by CANOpen.
- Parameters
can_device (ingenialink.canopen.net.CAN_DEVICE) – CANOpen device type.
dict_path (str) – servo dictionary path.
eds_file (str) – EDS file path.
node_id (int) – node id. It’s posible scan node ids with
scan_servos_canopen()
.baudrate (ingenialink.canopen.net.CAN_BAUDRATE) – communication baudrate. 1 Mbit/s by default.
channel (int) – CANOpen device channel.
0
by default.alias (str) – servo alias to reference it.
default
by default.
-
connect_servo_ecat
(ifname, dict_path, slave=1, eoe_comm=True, alias='default', reconnection_retries=None, reconnection_timeout=None)¶ Connect servo by ECAT with embedded master.
- Parameters
ifname (str) – interface name. It should have format
\Device\NPF_[...]
.dict_path (str) – servo dictionary path.
slave (int) – slave index.
1
by default.eoe_comm (bool) – use eoe communications if
True
, ifFalse
use SDOs.True
by default.alias (str) – servo alias to reference it.
default
by default.
-
connect_servo_ecat_interface_index
(if_index, dict_path, slave=1, eoe_comm=True, alias='default', reconnection_retries=None, reconnection_timeout=None)¶ Connect servo by ECAT with embedded master. Interface should be selected by index of list given in
get_interface_name_list()
.- Parameters
if_index (int) – interface index in list given by function
get_interface_name_list()
.dict_path (str) – servo dictionary path.
slave (int) – slave index.
1
by default.eoe_comm (bool) – use eoe communications if
True
, ifFalse
use SDOs.True
by default.alias (str) – servo alias to reference it.
default
by default.reconnection_retries (int) – Number of reconnection retried before declaring a connected or disconnected stated.
reconnection_timeout (int) – Time in ms of the reconnection timeout.
-
connect_servo_eoe
(ip, dict_path=None, alias='default', protocol=<Protocol.UDP: 2>, port=1061, reconnection_retries=None, reconnection_timeout=None)¶ Connect to target servo by Ethernet over EtherCAT
- Parameters
ip (str) – servo IP.
dict_path (str) – servo dictionary path.
alias (str) – servo alias to reference it.
default
by default.protocol (Protocol) – UDP or TCP protocol.
UDP
by default.port (int) – servo port.
1061
by default.reconnection_retries (int) – Number of reconnection retried before declaring a connected or disconnected stated.
reconnection_timeout (int) – Time in ms of the reconnection timeout.
-
connect_servo_ethernet
(ip, dict_path=None, alias='default', protocol=<Protocol.UDP: 2>, port=1061, reconnection_retries=None, reconnection_timeout=None)¶ Connect to target servo by Ethernet
- Parameters
ip (str) – servo IP
dict_path (str) – servo dictionary path.
alias (str) – servo alias to reference it.
default
by default.protocol (Protocol) – UDP or TCP protocol.
UDP
by default.port (int) – servo port.
1061
by default.reconnection_retries (int) – Number of reconnection retried before declaring a connected or disconnected stated.
reconnection_timeout (int) – Time in ms of the reconnection timeout.
-
disconnect
(servo='default')¶ Disconnect servo.
- Parameters
servo (str) – servo alias to reference it.
default
by default.
-
static
get_ifname_by_index
(index)¶ Return interface name by index.
- Parameters
index (int) – position of interface selected in
get_interface_name_list()
.- Returns
- real name of selected interface.
It can be used for function
connect_servo_ecat()
.
- Return type
-
static
get_interface_name_list
()¶ Get interface list.
- Returns
List with interface readable names.
- Return type
list of str
-
get_register
(register, servo='default', axis=1)¶ Return the value of a target register.
-
get_sdo_register
(index, subindex, dtype, string_size=None, servo='default')¶ Return the value via SDO of a target register.
- Parameters
- Returns
Current register value.
- Return type
-
load_firmware_canopen
(fw_file, servo='default', status_callback=None, progress_callback=None, error_enabled_callback=None)¶ Load firmware via CANopen.
-
load_firmware_ecat
(ifname, fw_file, slave=1, boot_in_app=True)¶ Load firmware via ECAT.
-
load_firmware_ecat_interface_index
(if_index, fw_file, slave=1, boot_in_app=True)¶ Load firmware via ECAT.
- Parameters
if_index (int) – interface index in list given by function
get_interface_name_list()
.fw_file (str) – Firmware file path.
slave (int) – slave index.
1
by default.boot_in_app (bool) – If summit series -> True. If capitan series -> False. If custom device -> Contact manufacturer.
-
load_firmware_ethernet
(ip, fw_file, ftp_user=None, ftp_pwd=None)¶ Load firmware via Ethernet. Boot mode is needed to load firmware.
Warning
After functions ends, the servo will take a moment to load firmware. During the process, the servo will be not operative.
-
scan_servos_canopen
(can_device, baudrate=<CAN_BAUDRATE.Baudrate_1M: 1000000>, channel=0)¶ Scan CANOpen device network to get all nodes.
- Parameters
can_device (ingenialink.canopen.net.CAN_DEVICE) – CANOpen device type.
baudrate (ingenialink.canopen.net.CAN_BAUDRATE) – communication baudrate. 1 Mbit/s by default.
channel (int) – CANOpen device channel.
0
by default.
- Returns
List of node ids available in the network.
- Return type
list of int
-
scan_servos_ecat
(ifname)¶ Return a list of available servos.
- Parameters
ifname (str) – interface name. It should have format
\Device\NPF_[...]
.- Returns
Drives available in the target interface.
- Return type
list of int
-
scan_servos_ecat_interface_index
(if_index)¶ Return a list of available servos.
- Parameters
if_index (int) – interface index in list given by function
get_interface_name_list()
.- Returns
Drives available in the target interface.
- Return type
list of int
-
set_register
(register, value, servo='default', axis=1)¶ Set a value of a target register.
-
set_sdo_register
(index, subindex, dtype, value, servo='default')¶ Set the value via SDO of a target register.
-
subscribe_net_status
(callback, servo='default')¶ Add a callback to net status change event.
- Parameters
callback (callable) – when net status changes callback is called.
servo (str) – servo alias to reference it.
default
by default.
-
subscribe_servo_status
(callback, servo='default')¶ Add a callback to servo status change event.
- Parameters
callback (callable) – when servo status changes callback is called.
servo (str) – servo alias to reference it.
default
by default.
-
class