Skip to main content

Python wrapper for zlgcan driver.

Project description

ZLGCAN驱动及集成到python-can(因内存模型不同,目前Windows下32位python会报内存非法访问的错误)

  1. 准备

    • 确保安装相关驱动(USBCAN-I/II驱动得额外安装)
    • 确保安装相VC++运行环境
    • 下载library文件夹(里面包含bitrate.cfg.yaml)
    • 在当前工程目录下(相对运行脚本)新建一个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"
    
  2. 安装zlgcan-driver-py(不建议使用低于0.1.10版本)

    pip install zlgcan >= 0.1.10
    
  3. 使用:

    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)
    
  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信息
    • 该库主要依赖ecu-proto-rs,如有问题,请提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.1.13.tar.gz (6.3 MB view details)

Uploaded Source

Built Distributions

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

zlgcan-0.1.13-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (500.9 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp312-cp312-win_amd64.whl (316.9 kB view details)

Uploaded CPython 3.12Windows x86-64

zlgcan-0.1.13-cp312-cp312-win32.whl (309.6 kB view details)

Uploaded CPython 3.12Windows x86

zlgcan-0.1.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp311-cp311-win_amd64.whl (316.3 kB view details)

Uploaded CPython 3.11Windows x86-64

zlgcan-0.1.13-cp311-cp311-win32.whl (310.3 kB view details)

Uploaded CPython 3.11Windows x86

zlgcan-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp310-cp310-win_amd64.whl (316.3 kB view details)

Uploaded CPython 3.10Windows x86-64

zlgcan-0.1.13-cp310-cp310-win32.whl (310.2 kB view details)

Uploaded CPython 3.10Windows x86

zlgcan-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp39-cp39-win_amd64.whl (317.4 kB view details)

Uploaded CPython 3.9Windows x86-64

zlgcan-0.1.13-cp39-cp39-win32.whl (310.3 kB view details)

Uploaded CPython 3.9Windows x86

zlgcan-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (500.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

zlgcan-0.1.13-cp38-cp38-win_amd64.whl (317.4 kB view details)

Uploaded CPython 3.8Windows x86-64

zlgcan-0.1.13-cp38-cp38-win32.whl (310.4 kB view details)

Uploaded CPython 3.8Windows x86

zlgcan-0.1.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (500.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: zlgcan-0.1.13.tar.gz
  • Upload date:
  • Size: 6.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13.tar.gz
Algorithm Hash digest
SHA256 1ef0548baf10f663ff9348f49131611228f8e5c36978e7d6d785981244ec583b
MD5 0c5a78f5861068ca882bd1f7b6e426ea
BLAKE2b-256 dac18296c92d0c8b723f70d05489213164b20b8b9fd000b50ef00db086d1e78b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27bffc6fa1c89608a27c59d138b75c63a6adb4c7693f6c519d7e3a0c2e10eadd
MD5 7237ff4647951d9c9ff07e8ae5ecdc63
BLAKE2b-256 4c03be26ae6ca938b44c4e12c3ea77aa394d51fda74823c7eaecba3cb74fb4a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fc731e9fb8593f4d043f2a940bf8952e8b5ee2987afc588b020f067e9e6a5ff
MD5 0b54df5fa7b4a448c5b98b7812384eb8
BLAKE2b-256 66fd20b322140ffc8aadd09ca33da06cdfd0d0fb3cc415cf72b503bef2845d17

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9bd520406b4cb746170b8470e97670ae4a8b80e98ce166f29d1b7e2fc470c556
MD5 15b51c4ec58c9470962fcd526a3c4885
BLAKE2b-256 beeb4f9313d279ace32811d73f52f9f9b7e32a282a7718c3fbd7866a4ca91704

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp312-cp312-win32.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp312-cp312-win32.whl
  • Upload date:
  • Size: 309.6 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 195036630a9de1dc5a3ba98c014a9a532b588a9848d353b32721feb731cb8d63
MD5 0f688a5b895c0848e8dea693f909cf12
BLAKE2b-256 a3ccd53bbd992393fe89f0e613d17f95d388163247c94df8c63b09c671441c4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7b086ea943498d8017d15c1be693b0b5e68ec968def1917388e76bd7c2232aa6
MD5 5a4be7995459c19defb8d652928a216e
BLAKE2b-256 d006b3667bc5b7bbe666ba1369df63c535bd3875d1729e76d499b376c130b11f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c328884e8aec4918ea31c76b6173cbb1755c23ec19adaa68d1240a7ae0945492
MD5 c90bd1638c23e41220795d0891d6b21f
BLAKE2b-256 1d4b46f7af1fbe5a803facc02dc5c2e9d1ce299f853cf20d07b1e678bc28763f

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp311-cp311-win32.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp311-cp311-win32.whl
  • Upload date:
  • Size: 310.3 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 f0afa600902491f2cf1b2b12643a0e1538c660e4f7e3a49ec340f5f16ab30c9c
MD5 575ca5d1dcdc0de51c45480a2b1d3ab4
BLAKE2b-256 cbbc8b96a5106bc5da7421f9b0323bb24efda91fad804160bd3f92bb29acd3b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fb6270a1fe6a231de4042530746d24c7b7405a61724195680050797e7d64b119
MD5 6c483e64fd099fd39fd53caa95257c98
BLAKE2b-256 c16e6112c298a7b3a82313e7c64276313386146d785a2f00369dceb4712394c1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.13-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d1a7240153ee6a632a6538769b1258f21783176f31732e80e846f869440bb203
MD5 6caa1ad8ee9a993cc02bf9daacd307f4
BLAKE2b-256 3e3500df4bd0a959c82a781351f6fe53ce4f27ecea4377463e7195ba66544d39

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp310-cp310-win32.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp310-cp310-win32.whl
  • Upload date:
  • Size: 310.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 cff86c69d6913c0a66e185f2f68b6579f3a5542800217e037775d7832882b935
MD5 5d1b59e5bd85e0df913d77d567ea79cd
BLAKE2b-256 af44bb875c06d9c19c34768b5bbb07e9059ba5127da09698f67a3c1ca867a5c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63d6c6307ea204405422c485c5c21c1846341bec6d767f0482dd5b7039c4413f
MD5 2dee0acfd0b1244b9aa78b160426cffc
BLAKE2b-256 9040d80099ba4810ea7a933bf8fe5503858922547802a99f42dc86d953455592

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.13-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a0a3756622714f697438d88e717f57ef91c51af9d31a9df249a9d1795310847a
MD5 daf9be45ef78ddf8a038bff12883488b
BLAKE2b-256 04555c65e83bfe02f13f335e48181f991bea975e8d7f170e05b44deffb9ce03c

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp39-cp39-win32.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp39-cp39-win32.whl
  • Upload date:
  • Size: 310.3 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 403f52029bc0f675087410e58cd662bf17a8364f2e9386019d9d218b57532ac8
MD5 9b4dc39c4968fb5d3ca46be0709588f7
BLAKE2b-256 42c13232872a06581c9c39868c506be436307d37c393f92d4371d9a371766221

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d8b1ab134329e8043898f5e1160466f1f04c8cb8211ebdce0ed157b9d099ec4f
MD5 926419268c44c1519cc5d94241c356ab
BLAKE2b-256 c4e660a7bd67b717a7668f3227694202162d7fb7c25495fc1734d97145f0be6a

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 317.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f1f8859d3afe5f2f3bc0e066950bee0425b1cba3da35fa9611cbfb18b6710b26
MD5 243129f0e8aba8af2f92a2e3918403dd
BLAKE2b-256 ad743741e8cc45e0c585bba8dc6bc79a106b3847ff877158f048f0b0445c82c6

See more details on using hashes here.

File details

Details for the file zlgcan-0.1.13-cp38-cp38-win32.whl.

File metadata

  • Download URL: zlgcan-0.1.13-cp38-cp38-win32.whl
  • Upload date:
  • Size: 310.4 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for zlgcan-0.1.13-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 678adbfd070497b06a4025b44d3fc6dbd40b652a4257f72ff77dab71fd365bd6
MD5 c352dd13a0522bd11e93580215ff5b92
BLAKE2b-256 b7d8c1ac82f196f8c852ed157ecce66807887bc46c57b794e5096fa9e4ab0044

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 de647dbae9c237be9b1cdcebb929cd2b41d58a64a3b3e28700dc2b37941d4e56
MD5 bce23e2ca24b21fcd19f0ecacadb4a15
BLAKE2b-256 e55587536dff4b15dd426c74b4e5a3834c61767681922d8740bfbb70720b7031

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