Python wrapper for zlgcan driver.
Project description
ZLGCAN驱动及集成到python-can(因内存模型不同,目前Windows下32位python会报内存非法访问的错误)
-
准备
- 确保安装相关驱动(USBCAN-I/II驱动得额外安装)
- 确保安装相VC++运行环境
- 将library文件夹及bitrate.cfg.yaml文件拷贝到当目录(v0.1.5前版本)
- 在当前工程目录下(相对运行脚本)新建一个
zcan.env文件, 中间配置ZCAN_LIBRARY环境变量(相对路径/绝对路径),否则使用默认(相对运行脚本)路径:- 默认(相对运行脚本)路径文件夹内容示例:
├─main.py ├─library │ ├──linux │ │ └─x86_64 │ └─windows │ ├─x86 │ └─x86_64 └─ bitrate.cfg.yaml
- (相对运行脚本)
zcan.env文件指定library示例:
├─main.py ├─zcan.env └─library ├─linux │ └─x86_64 ├─windows │ ├─x86 │ └─x86_64 └─ bitrate.cfg.yaml
- 以下为
zcan.env文件内容示例
ZCAN_LIBRARY="C:/your_library_path"
-
安装zlgcan-driver-py(不建议使用低于0.1.10版本)
pip install zlgcan >= 0.1.10
-
使用:
import can from zlgcan.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波特率计算软件
bitrate.cfg.yaml文件中USBCANFD设备只配置了500k及1M的波特率, 如需使用其他波特率, 请自行添加
- 其他CANFD类型的CAN卡仅仅在Linux上使用时
bitrate.cfg.yaml中配置- 此时计算相关值可以通过
ZCANPRO软件
- 此时计算相关值可以通过
- 在Linux上使用ZCAN_USBCAN1衍生CAN卡时, 请在初始化时候设置
ZCanDeriveInfo信息 - 该库主要依赖ecu-proto-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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zlgcan-0.1.10.tar.gz.
File metadata
- Download URL: zlgcan-0.1.10.tar.gz
- Upload date:
- Size: 6.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
475b50e24b3c153d03f25eaec9070633e34ac621a92d976e3b3009bb527dadbc
|
|
| MD5 |
09387a088a028e0f6da137e5af415fe6
|
|
| BLAKE2b-256 |
6967131f77513bbb1ad3a7d7370c740d0c92482daaee9e198bfc9b116d5ae042
|
File details
Details for the file zlgcan-0.1.10-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 491.8 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ff1ab6deccd31172f934485f87b29a1e2d6ac1e744c378f39ce5006a56327a
|
|
| MD5 |
6ccfe75542d3cac6730b8be1b098dad9
|
|
| BLAKE2b-256 |
5e4b1bbc84f138e7ca515873f16f2f554d034a949e2f6c7a579c2e1462704d43
|
File details
Details for the file zlgcan-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 489.6 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c709bab1d8868f21beb0e9d03b82483a038f6ed7ae2703e0638c23b4c5c2b6f
|
|
| MD5 |
1b2cc0a43dfa87fa53ef9b6987eac431
|
|
| BLAKE2b-256 |
fb4088be1b7f69981db9ec6dddf866b52bcf61105165e32791ee7656aa4c6a05
|
File details
Details for the file zlgcan-0.1.10-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 315.5 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46080ddd2bc31306ebad293fb4c711b8d4354ba4cc1b6f1a2e9cc26b8a32c5c5
|
|
| MD5 |
c5a2a7929d0c7a6e8202ad05434c7058
|
|
| BLAKE2b-256 |
6ac8bca25206ecee734c94a79710590aa6f61e4201efc5fa1953b25cf7eae9e3
|
File details
Details for the file zlgcan-0.1.10-cp312-cp312-win32.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp312-cp312-win32.whl
- Upload date:
- Size: 308.0 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ad86344b56602965a2f955eeb796d6fda1a4eff8bd8008e996ff008191528b
|
|
| MD5 |
7ff8e6623c0d7233be27e568e7b8a12c
|
|
| BLAKE2b-256 |
8699bc26dc90d340aa935116822441d27315d1ed8d5970d6250f091bbec2d1f4
|
File details
Details for the file zlgcan-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 490.1 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147f36b6499c0762099a26564e3c6e2b79ce7257894265b2d761aaecaef03b8a
|
|
| MD5 |
b616eb0404b0df7db046b419f5424a29
|
|
| BLAKE2b-256 |
e814f7e82d44c7c74292d1bb9d4ec8243a53903056c42f2cb5c0a9c2671df68c
|
File details
Details for the file zlgcan-0.1.10-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 315.6 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78d220a0cad47b89ea5c27f8b52c5a36f1b8243c6338c29ee1e75d53a2cf174a
|
|
| MD5 |
241f072ae34e0ab4ff96f8a766a680bc
|
|
| BLAKE2b-256 |
c7378fb06c5710ab6fc19e7c7c3408905241bc4fba4faf05297dc465c406e36a
|
File details
Details for the file zlgcan-0.1.10-cp311-cp311-win32.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp311-cp311-win32.whl
- Upload date:
- Size: 309.1 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f49a8dec81fcd235dbc562c8191f47f79f806fc03b51377f131de7e9865743d
|
|
| MD5 |
bf2d3ab1e4fac2c874b1adc86c2e0d4e
|
|
| BLAKE2b-256 |
a02d29202079ef05a5a399c9c4df1886848a69d030df7ad1a36f3ed973059427
|
File details
Details for the file zlgcan-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 490.8 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3a182f6d6756b9da48fddbec28ba03ed722e5c439dbb7284b25cc6dc38d86ca
|
|
| MD5 |
28dd7e31d499c01652b1ef251ff55c60
|
|
| BLAKE2b-256 |
ef3acaaea4ad0b17c0715654951cc4c402a8f1616432af3c3a6ce4e0763cecc6
|
File details
Details for the file zlgcan-0.1.10-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 315.5 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
281ef3729cf3b17c26898abeb22d09a3034b641a802cb3248b52cad981c9aa45
|
|
| MD5 |
f0184a813fd65a434ddd2e97d3227d63
|
|
| BLAKE2b-256 |
7b202f7eda0839e8f79e5cfa943857d43fd62ff714d39ae35e5978a55e53d604
|
File details
Details for the file zlgcan-0.1.10-cp310-cp310-win32.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp310-cp310-win32.whl
- Upload date:
- Size: 309.0 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c002f82c1452f58e358399468047898cda564318feada4a2b1deb9951e089cbd
|
|
| MD5 |
2d606dc7246a774d05bd34fc96da039b
|
|
| BLAKE2b-256 |
7426f3854b511daa276a579d4d7e32c490a5cb61796682ee50ca868f114b3864
|
File details
Details for the file zlgcan-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 490.9 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd822fa84d56b260a35c73f933d7a549206a24ba0a1d5d8e2c0fc9dd812fd373
|
|
| MD5 |
5c83138298cf2213bfbeb7311992826b
|
|
| BLAKE2b-256 |
0db5926fdcba0d94e51f83820203415c07e3c6591f8bc32ae4bbfd294fd3133f
|
File details
Details for the file zlgcan-0.1.10-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 316.6 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb02bd315a6c0e30cd6041cee395ea87ebfc0ee29d02cc459b635c74cfb1fbc7
|
|
| MD5 |
624547e87d9ece6ab3c88ed4b6dea2fc
|
|
| BLAKE2b-256 |
7534698307d3d7238f0691a3f2b0dba1d5e053bd97dd6b4adcc691f3e3566f21
|
File details
Details for the file zlgcan-0.1.10-cp39-cp39-win32.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp39-cp39-win32.whl
- Upload date:
- Size: 309.2 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1e8fc1ac543810b35df8fc2c9335019cb43e081bcc815a60bc9c172949ed3e5
|
|
| MD5 |
fc70e53767d9b7da93cc18e9a925af3b
|
|
| BLAKE2b-256 |
355605222c2b615951f84a9a7b0d698bc4a5088c8aaae334eefc85531ae3bbb9
|
File details
Details for the file zlgcan-0.1.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 492.5 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68db532e928cc9adb51cb9ed466a978ee859f95f435dfcb3b8adb6a9ffd9c499
|
|
| MD5 |
b6bc8eb2f73abcc8f3736bb6d4791764
|
|
| BLAKE2b-256 |
90ad347ba9069e49a20a205f6ac79c09ccd703059dbf260e04860edc7f7f9385
|
File details
Details for the file zlgcan-0.1.10-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 316.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47c2ddb4659f01169c4e35a874e4f9412726c365f3d97e78f0e49cfebd93c244
|
|
| MD5 |
0abbe63a2b2ea22aebde7ad6cdf9af8b
|
|
| BLAKE2b-256 |
d5536301f647c5fc2075ca61b55f8447930980e1f2e965542f13fb6d816de077
|
File details
Details for the file zlgcan-0.1.10-cp38-cp38-win32.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp38-cp38-win32.whl
- Upload date:
- Size: 309.4 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a0884b302edf52b1ffb61ac8bda9c8af0aa5698c3017edfc29bd1ea8a24fd0a
|
|
| MD5 |
14c6c85a81db2c00115e4adae63cf9bc
|
|
| BLAKE2b-256 |
0b4832fa085b1ad69f6934e4b0cad4568ed79eb3171aadd6390efc744f7bf9fb
|
File details
Details for the file zlgcan-0.1.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: zlgcan-0.1.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 492.1 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae137f88b2737a1a8f33c1be7f5d23bc9eba936ec355379746b0f7309dd62ab6
|
|
| MD5 |
3d165eab2f49d2970d4e88f259a0940d
|
|
| BLAKE2b-256 |
d7fba2b0474516f18f021141a0efa0903e6f2dda08eb8eefbc92328c3c890119
|