Network¶
- class ingenialink.canopen.net.CAN_BAUDRATE(value)[source]¶
Baudrates.
- Baudrate_100K = 100000¶
100 Kbit/s
- Baudrate_125K = 125000¶
125 Kbit/s
- Baudrate_1M = 1000000¶
1 Mbit/s
- Baudrate_250K = 250000¶
250 Kbit/s
- Baudrate_500K = 500000¶
500 Kbit/s
- Baudrate_50K = 50000¶
50 Kbit/s
- class ingenialink.canopen.net.CAN_BIT_TIMMING(value)[source]¶
Baudrates.
- Baudrate_100K = 5¶
100 Kbit/s
- Baudrate_125K = 4¶
150 Kbit/s
- Baudrate_1M = 0¶
1 Mbit/s
- Baudrate_250K = 3¶
250 Kbit/s
- Baudrate_500K = 2¶
500 Kbit/s
- Baudrate_50K = 6¶
50 Kbit/s
- class ingenialink.canopen.net.CAN_DEVICE(value)[source]¶
CAN Device.
- IXXAT = 'ixxat'¶
Ixxat.
- KVASER = 'kvaser'¶
Kvaser.
- PCAN = 'pcan'¶
Peak.
- class ingenialink.canopen.net.HearbeatThread(parent, node)[source]¶
Heartbeat thread to check if the drive is alive.
- Parameters
parent (Network) – network instance of the CANopen communication.
node (int) – Identifier for the targeted node ID.
- run()[source]¶
Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
- class ingenialink.canopen.net.Network(device=None, channel=0, baudrate=CAN_BAUDRATE.Baudrate_1M)[source]¶
Network of the CANopen communication.
- Parameters
device (CAN_DEVICE) – Targeted device to connect.
channel (int) – Targeted channel number of the transciever.
baudrate (CAN_BAUDRATE) – Baudrate to communicate through.
- property baudrate¶
Current baudrate of the network.
- Type
int
- change_node_baudrate(target_node, vendor_id, product_code, rev_number, serial_number, new_node=None, new_baudrate=None)[source]¶
Changes the node ID and the baurdrate of a targeted drive.
- Parameters
target_node (int) – Node ID of the targeted device.
vendor_id (int) – Vendor ID of the targeted device.
product_code (int) – Product code of the targeted device.
rev_number (int) – Revision number of the targeted device.
serial_number (int) – Serial number of the targeted device.
new_node (int) – New node ID for the targeted device.
new_baudrate (int) – New baudrate for the targeted device.
- Returns
Result of the operation.
- Return type
bool
- connect_through_node(eds, dict, node_id, boot_mode=False, heartbeat=True)[source]¶
Connects to a drive through a given node ID.
- Parameters
eds (str) – Path to the EDS file.
dict (str) – Path to the dictionary file.
node_id (int) – Targeted node ID to be connected.
boot_mode (bool) – Value to avoid reading unnecessary regtisters when connecting.
heartbeat (bool) – Value to initialize the HeartBeatThread.
- detect_nodes()[source]¶
Scans for nodes in the network.
- Returns
Containing all the detected node IDs.
- Return type
list
- net_state_subscribe(cb)[source]¶
Subscribe to netowrk state changes.
- Parameters
cb – Callback
- Returns
Assigned slot.
- Return type
int
- property network¶
Returns the instance of the CANopen Network.
- Type
canopen.Network
- scan(eds, dict, boot_mode=False, heartbeat=True)[source]¶
Scans the network and automatically connects to the first detected node ID.
- Parameters
eds (str) – Path to the EDS file.
dict (str) – Path to the dictionary file.
boot_mode (bool) – Value to avoid reading unnecessary regtisters when connecting.
heartbeat (bool) – Value to initialize the HeartBeatThread.
- property servos¶
Servos available in the network.
- Type
list