hardbyte / hardbyte/python-can

How to connect to sysworxx usb-CANmodul2?

Đang mở
#1,308 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
1.6k
Fork
697
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.