Skip to main content

Python wrapper for zlgcan driver.

Project description

PyPI Downloads PyPI Downloads

ZLGCAN驱动及集成到python-can(不支持32位)

  1. 准备

    • 确保安装相关驱动(USBCAN-I/II驱动得额外安装)
    • 确保安装相VC++运行环境
    • 下载library文件夹(里面包含bitrate.cfg.yaml)
    • 库文件示例:
      library
        ├──bitrate.cfg.yaml
        ├──linux
          └─x86_64
        └─windows
           └─x86_64
      
    • 在初始化can.Bus的时候指定zlgcan库路径(从0.2.0开始移除zcan.env配置), 默认为相对工程运行文件同级目录下library
      libpath=r"C:\your\library\path"
      
  2. 安装zlgcan(不建议使用低于0.2.0版本)

    pip install zlgcan >= 0.2.0
    
  3. 使用:

    import can
    from zlgcan.zlgcan import ZCanTxMode, ZCANDeviceType
    
    with can.Bus(interface="zlgcan", device_type=ZCANDeviceType.ZCAN_USBCANFD_200U,
                 libpath="library/",
                 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)
    
  4. 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
  5. 注意事项:

    • 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信息
    • 该库主要依赖rust-can,如有问题,请提issue
  6. 官方工具及文档:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zlgcan-0.2.4.tar.gz (18.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

zlgcan-0.2.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.4 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.6 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (482.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp313-cp313-win_amd64.whl (308.1 kB view details)

Uploaded CPython 3.13Windows x86-64

zlgcan-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (482.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp312-cp312-win_amd64.whl (308.5 kB view details)

Uploaded CPython 3.12Windows x86-64

zlgcan-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (482.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp311-cp311-win_amd64.whl (308.8 kB view details)

Uploaded CPython 3.11Windows x86-64

zlgcan-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (482.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp310-cp310-win_amd64.whl (308.5 kB view details)

Uploaded CPython 3.10Windows x86-64

zlgcan-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (483.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp39-cp39-win_amd64.whl (309.4 kB view details)

Uploaded CPython 3.9Windows x86-64

zlgcan-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

zlgcan-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (484.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file zlgcan-0.2.4.tar.gz.

File metadata

  • Download URL: zlgcan-0.2.4.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4.tar.gz
Algorithm Hash digest
SHA256 5f71646e3988bd2ffcd01d880286cb3feaea4e143a7c16bd36191177a15c7433
MD5 1ea4b18617307ec34c506210199176e5
BLAKE2b-256 9aa7cfac7c494eba4d6c2b9b85ad042ff7d5795a61021f84939231acac98efaf

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bcb47f53c4948db8e078ef16dd53dcaed531595b214f0529f2f763d68953ec42
MD5 528e158a954cfd1104341427efe90170
BLAKE2b-256 1cf31968777a133a56a9f2dccf7ca352c66f4ee6f804638b3771a3f78286a5a3

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 387e4f5687e898528ee35b7822a800abf5c66a458fc75bbcd9647a4d71bb1835
MD5 158a4cd46b7d8f0f8ae2a5cafebaa135
BLAKE2b-256 6084c29ad3d621d6b02a7a59c3182462f7dac39391edd24229c12caf32c80cea

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c493c74d127d2dedc541002d52d44a1f5d19859c6238caf1471ba4a3add12d3
MD5 ba09739009cc49090141c24649532b20
BLAKE2b-256 c27a2a4338cdef0ada19f02638e54fe86c8943470a07b5e74773a4dcf2b49345

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 308.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e2562dd13722b228630b6d377c663c111e8f9a954f0dba7d20aefef794c08e2b
MD5 0ae5aad0ed3e09f3e5ad6b1662a4dd3a
BLAKE2b-256 550c5b50ce289105ec40670ddadbd00af3eec3e6fb16a9208989f51963ece7c4

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35c430c056e536aa840057322aea39d534c7c0220aa6398eec13499d2918ae63
MD5 99efc15977f944e8552b1e3e21783723
BLAKE2b-256 0a4e0aa1faaa5af3abb257d824994dfa5a2aa9ca2e4420c18f83c98cbe06e4f5

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 308.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c5bacb9c2ec534ef3838f2800b22694eebed6d2a827a2286c72eacf2eddfa232
MD5 8eb005cf98b9579b1dee8ebd9b52bf52
BLAKE2b-256 69f52e38fc06620b3af3a1c235d609705a3fdaeec05965c98e255c1dbf057198

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8658804b1f7d3cac0abe7d3d683554d269d1f5c38cd39ada557e40b16f176c2
MD5 6eff1c2f0def46a08c19a02313671ae7
BLAKE2b-256 641ef3d6de51fa4a8996f8628b2d710c9230b53177f1f9247f2d7611dd3e6447

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.2.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 308.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 096f90628f964cd72fa8a9a4af9cb9b97f9a6f88b3450bc3426b0bbcaab62180
MD5 d96e2f3a7539b76cc5d44adb232ad0e9
BLAKE2b-256 0b2d42b2725f29c98bfc45e48ec0e94585f0646c86a166fe4ed3e9732b917c76

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0040c2058f9984f79ef581d8d6b67901075c1d168cf4cb5b877e594ce14de1c5
MD5 9dea084701ca1d100173f75c13882a87
BLAKE2b-256 f5ed6cc9f282f8d832d07e6ce8807b21aeeab61f79cb0935f333b44db63e6572

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.2.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 308.5 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 7ba6a12708f9e1abb1c09ba548c84617aba827a2e3858effebde2d4e2e7475de
MD5 007479a657f9122b907e8190a25e7124
BLAKE2b-256 bd89827189c980439f7d28d9e762d83ac1bb85e46a0d65f151a2215f237e5b0b

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9299afe9a8c96a3bc51eef8fae1a7f023dfede5f79a9ff5a3bf66cd04098ee58
MD5 c9036c9010a491d57bd1ab9f64644b7a
BLAKE2b-256 7c70bb06611ae5b671e2f73070ba70c077dfee4452b5666e71aa98f48e78248d

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.2.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 309.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.0

File hashes

Hashes for zlgcan-0.2.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 87dae76ec045f5d935c0099faae7a4ba8d41b6e6f272901c42f0ddb6a9574110
MD5 9d1511b863d2f6afa67e2066124e3b42
BLAKE2b-256 59a290293459d839e13cbde199d7f0ec3d6db5d0795fabdf37b9d08f47b5967f

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7818af0f932b541bb5bc0b5eb8189449a816d032380bae837175c3d4c71345f2
MD5 f82241694ba6d4e8ba932b6460ae2486
BLAKE2b-256 9d3f16d80987ba1cf931c1b59ec4822c5c30a982c1404693dcb77e6af645441d

See more details on using hashes here.

File details

Details for the file zlgcan-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for zlgcan-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cdaa094593f374be86913a0be557da9892988bdf143af510021c264f7bee5352
MD5 fdaba5307d18c4bc578fecb66904e9a8
BLAKE2b-256 aa7a7e3974795d1b82a96d54780bebbbd69f44ffb90c2f1eaf8c3881663b6c78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page