Python wrapper for zlgcan-driver-rs.
Reason this release was yanked:
Bug on windows
Project description
ZLGCAN驱动及集成到python-can(因内存模型不同,目前Windows下32位python会报内存非法访问的错误)
-
安装python-can
pip install python-can
-
找到python-can安装路径
- windows下一般不用虚拟环境安装则在python安装路径下Lib/site-packages
- linux下一般不用虚拟环境安装则在用户home目录./locals/lib/PythonVersion/Lib目录下
- 使用虚拟环境则在虚拟环境下Lib/site-packages
-
修改python-can路径下的can/interfaces/__init__.py文件, 在BACKENDS字典中添加一行:
"zlgcan": ("can.interfaces.zlgcan", "ZCanBus"),
-
将
zlgcan
文件夹拷贝到can/interfaces/
文件夹下 -
安装zlgcan-driver-py库:
pip install zlgcan-driver-py
-
将libary文件夹及bitrate.cfg.yaml文件拷贝到当前工程根目录下
-
使用:
import can from can.interfaces.zlgcan import ZCanTxMode, ZCANDeviceType with can.Bus(interface="zlgcan", device_type=ZCANDeviceType.ZCAN_USBCANFD_200U, configs=[{'bitrate': 500000, 'resistance': 1}, {'bitrate': 500000, 'resistance': 1}]) as bus: bus.send(can.Message( arbitration_id=0x123, is_extended_id=False, channel=0, data=[0x01, 0x02, 0x03, ], dlc=3, ), tx_mode=ZCanTxMode.SELF_SR) # time.sleep(0.1) _msg = bus.recv() print(_msg)
-
CAN测试列表:
- USBCAN-I-mini - ZCAN_USBCAN1, ZCAN_USBCAN2
- USBCAN-4E-U - ZCAN_USBCAN_4E_U
- USBCANFD-100U-mini - ZCAN_USBCANFD_MINI
- USBCANFD-100U - ZCAN_USBCANFD_100U
- USBCANFD-200U - ZCAN_USBCANFD_200U
- USBCANFD-800U - ZCAN_USBCANFD_800U
-
注意事项:
- ZCAN_USBCAN1及ZCAN_USBCAN2类型的设备无论是windows还是Linux, 波特率支持均在
bitrate.cfg.yaml
中配置- 此时计算timing0及timing1请下载CAN波特率计算软件
- 其他CANFD类型的CAN卡仅仅在Linux上使用时
bitrate.cfg.yaml
中配置- 此时计算相关值可以通过
ZCANPRO
软件
- 此时计算相关值可以通过
- 在Linux上使用ZCAN_USBCAN1衍生CAN卡时, 请在初始化时候设置
ZCanDeriveInfo
信息 - 该库主要依赖zlgcan-driver-rs,如有问题,请提issue
- ZCAN_USBCAN1及ZCAN_USBCAN2类型的设备无论是windows还是Linux, 波特率支持均在
-
官方工具及文档:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zlgcan_driver_py-0.1.5.tar.gz
(18.0 kB
view hashes)
Built Distributions
Close
Hashes for zlgcan_driver_py-0.1.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e57cd54237081ae825cbb3eea49127a4514be99fe0fda7b612741efc3f47aba |
|
MD5 | 771216bbe0a1d35fded3d0b8ae169492 |
|
BLAKE2b-256 | d8e7dbd95c8a4b06c8e130d688b0042dfc4a6b4d28da498adc0bee1008a4f616 |
Close
Hashes for zlgcan_driver_py-0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a14fbe1dd33a6996a8d36e9bae487aaffd7aa137a2ad4747fdd5a781568e64 |
|
MD5 | 4dbfbca2b3ea8977fbf2f14c29ce7009 |
|
BLAKE2b-256 | 4ff501452be8a5d389b872a8019d63c5923f6c19f674dd2a2daa7fa2d7dc1d3d |
Close
Hashes for zlgcan_driver_py-0.1.5-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f0a1de2fdb751d44d479dbdd8e27cd878130baff4f747246f6f4b5cd5b3cbbc |
|
MD5 | 8d6553cf77ab7f7778f6985d21a484cc |
|
BLAKE2b-256 | 679f62dfee2a0bdd99d29d9b603c8272df0af19859c49e8b5216f2607075effa |
Close
Hashes for zlgcan_driver_py-0.1.5-cp312-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f200efec5ba78bc83ed61a09f24b87e9bd184330f6c74336971826229a2af53b |
|
MD5 | 5ac603245aa31260f5daacfd2f427af6 |
|
BLAKE2b-256 | 02fc829202c32b7f8161ac9b8e7751f5606ee06ef1e3104d73c6af342590434e |
Close
Hashes for zlgcan_driver_py-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98d60123da70cd63a843c0497c5c98d32ad285d19ed2439266227188cbca8d3 |
|
MD5 | 4bd70c359e1a829733a66d238029f678 |
|
BLAKE2b-256 | f8f2613930ea63e6665db8b05749d3bafc73f64e350c7519955f1f338436924c |
Close
Hashes for zlgcan_driver_py-0.1.5-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15a1b6da543500b283a34d47d327c085e770a36d8a733db4bc91ec26821ea4f0 |
|
MD5 | d565bf5ea978c48049eb5e579d172374 |
|
BLAKE2b-256 | c642d6885dae1677710f6dc285325b76b2f73e18f78045d3d052292a51368491 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5725ea679a16134b570bca8fc094a57927d854094dc6c72d6269efc9edcb835 |
|
MD5 | 0bd6e991ecd920c66450da7234ee9acd |
|
BLAKE2b-256 | 81e05f669558769ba123434dc58b8587e538c7b891051a710f64a96cfedf4356 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4878ae768252fa44a5b859d9e86d2785fc4465b99fa7d411e895cc88fe002e0 |
|
MD5 | 1f70d0adeab16141c1b5b49f04c427b8 |
|
BLAKE2b-256 | 2e6bf46eb5666e2580a916478f968d8eecce585ae5bf50ac2a6598bb70338060 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d689684a8be60afb5749ad73e16984be57dd359c4ab1c36a56a9ee8f4b276c6a |
|
MD5 | 1be9785ec551b145c4eaadab405d1e47 |
|
BLAKE2b-256 | 411bada138d073a73414010d96c284d2d2abc27c57f04d38e7cb2abeeaa329a3 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe2908cbf8d44ebe0e82720a1cb19253e5af7bce84adc1ca6049af32f753844 |
|
MD5 | 55f1e94702a77e53b03ea61c84c2eda5 |
|
BLAKE2b-256 | 18d9754c878976fb47d51a37f8c3a0089d7ceb2cfd24b26adba017831f5ed332 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a4d4d7b772ad88d9b0ac93e4e5005fc6056fc822f91e3218b2730feb75174d3 |
|
MD5 | b31234bde1f67d066a5fd3c2169e986c |
|
BLAKE2b-256 | e6924421c2889721230c8d88fb3d660096b3037541c43ed36c3f510c8edc4233 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b283635da95dad62f05c5956c1946bdf845ae0e8edbfbad4d4e9bf748668665e |
|
MD5 | 2b9e85f0c8e68c3738ccffeb3d64baee |
|
BLAKE2b-256 | 051689eda28b0c74a64c2c97267a6d1e0690c3021564e4e515c59ab8ae43a845 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2ca1403b3550001d86d3a94e31092eece512a5e6d5d11d512252be1f31f97ae |
|
MD5 | fb05a9287f837eba5669b58e3a6c2abd |
|
BLAKE2b-256 | db1a561f16549fe6077ba35d1abeb4515756ac114968fd45f31cc9d4673a257f |
Close
Hashes for zlgcan_driver_py-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fb679a41a970d9c2ba3b457705659e38900c62cf684f684d4e95b4979c6212a |
|
MD5 | d1f7e95cf81b8c1c01f04d052784eacf |
|
BLAKE2b-256 | 419e4377f26c80a75f601566b9835436214fd576cc0f08b2294b389fd1ad1b67 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdaa863a008b54abc1f08cb21ed7a42481fb7d6f858fef3064df7108e61532fe |
|
MD5 | df75e08140cd00014c51ccd8e6ca0d4a |
|
BLAKE2b-256 | 8ceadf2947dbb2072fe7eed77962eacfacc5611eb1ce025dff84591e79b98ed9 |
Close
Hashes for zlgcan_driver_py-0.1.5-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859dfef3ef1778ca3dcd6c2799b6e0a5034980d8727f95989045bf3124244dce |
|
MD5 | a8398a67d398f1545439795b996d683e |
|
BLAKE2b-256 | a4301ac8bfedeb0a059a16c65d937cee75f7485ad811f1b053167d8a47e8858a |
Close
Hashes for zlgcan_driver_py-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0d317b7be98ab0ea151f6eb2c4316a2d310f859bb0f3f7dd1f394ccc158a22 |
|
MD5 | aceca2a3d902cea665f20e6222c6172b |
|
BLAKE2b-256 | 9e732e364baea848f745ce47d05a1b6e7230035ae520094cdd150ba575bbc583 |