'How to connect to sysworxx usb-CANmodul2 using canopen python lib?
I should connect to two channels of sysworxx USB-CANmodul2 device using canopen python lib at the same time. However, I get the following mistake: "Function UcanInitHardwareEx returned 5: the module with the specified device number is not connected (or used by an other application)". Here is the part of code for the first device:
network = canopen.Network()
network.connect(bustype='systec', channel=0, bitrate=500000)
print(f"Connected to CanModule_2: {self.network=}")
network.scanner.search()
sleep(1)
for node_id in network.scanner.nodes:
print(f"Found node abs encoder {node_id}")
node = network.add_node(node_id, os.path.join(Cfg.data_path, 'AHM.eds'))
Here is for the second one:
network = canopen.Network()
network.connect(bustype='systec', channel=1, bitrate=500000)
print(f"Connected to CanModule_1: {self.network=}")
network.scanner.search()
for node_id in network.scanner.nodes:
print(f"Found node {node_id}")
node = network.add_node(node_id, os.path.join(Cfg.data_path, 'Faulhaber.eds'))
These two connection are separated into two threads. Unfortunately, I can connect only to one channel. How to connect to two channels at the same time?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
