hardbyte / hardbyte/python-can

How to connect to sysworxx usb-CANmodul2?

Ouverte
#1,308 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Python
Étoiles
1.6k
Forks
697
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.