hardbyte / hardbyte/python-can

Using the canfox USB/CAN interface

Đang mở
#1,051 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
question
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ả

**Describe the bug**
This is not really a bug, more a question.

I'm trying to use a canfox usb/can interface https://www.ifm.com/fr/en/product/EC2112
I tried using bustype "serial", and "slcan" to no avail.

Am I missing something or is this hardware not supported?

```python
import canopen
import time

network = canopen.Network()

node = canopen.RemoteNode(32, 'DTM428.eds')
network.add_node(node)

network.connect(bustype='serial', channel="COM10", bitrate=125000)

device_name = node.sdo['Manufacturer device name'].raw
print(device_name)
network.sync.stop()
network.disconnect()
```

```
Traceback (most recent call last):
File "c:\rfid\main.py", line 28, in
device_name = node.sdo['Manufacturer device name'].raw
File "c:\rfid\venv\lib\site-packages\canopen\sdo\base.py", line 44, in __getitem__
entry = self.od[index]
File "c:\rfid\venv\lib\site-packages\canopen\objectdictionary\__init__.py", line 64, in __getitem__
raise KeyError("%s was not found in Object Dictionary" % name)
KeyError: 'Manufacturer device name was not found in Object Dictionary'
```

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.