Communication¶
-
class
ingeniamotion.communication.
Communication
(motion_controller)¶ Communication.
-
class
Protocol
(value)¶ Communication protocol enum
-
connect_servo_eoe
(ip, dict_path=None, alias='default', protocol=<Protocol.UDP: 2>, port=1061)¶ Connect to target servo by Ethernet over EtherCAT
-
connect_servo_ethernet
(ip, dict_path=None, alias='default', protocol=<Protocol.UDP: 2>, port=1061)¶ Connect to target servo by Ethernet
-
connect_servo_ecat
(ifname, dict_path, slave=1, eoe_comm=True, alias='default')¶ 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.
-
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
-
connect_servo_ecat_interface_index
(if_index, dict_path, slave=1, eoe_comm=True, alias='default')¶ 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.
-
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.
-
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
-
disconnect_canopen
(servo='default')¶ Disconnect CANOpen servo.
- Parameters
servo (str) – servo alias to reference it.
default
by default.
-
get_register
(register, servo='default', axis=1)¶ Return the value of a target register.
-
set_register
(register, value, servo='default', axis=1)¶ Set a 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
index (int) – register index.
subindex (int) – register subindex.
dtype (ingenialink.registers.REG_DTYPE) – register data type.
string_size (int) – if register data is a string, size in bytes is mandatory.
None
by default.servo (str) – servo alias to reference it.
default
by default.
- Returns
Current register value.
- Return type
-
set_sdo_register
(index, subindex, dtype, value, servo='default')¶ Set the value via SDO of a target register.
-
class