hardbyte / hardbyte/python-can

How to connect to sysworxx usb-CANmodul2?

オープン
#1,308 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
1.6k
フォーク
697
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。