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.11.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.11-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.7 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (496.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp312-cp312-win_amd64.whl (315.6 kB view details)

Uploaded CPython 3.12Windows x86-64

zlgcan-0.1.11-cp312-cp312-win32.whl (308.2 kB view details)

Uploaded CPython 3.12Windows x86

zlgcan-0.1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp311-cp311-win_amd64.whl (315.7 kB view details)

Uploaded CPython 3.11Windows x86-64

zlgcan-0.1.11-cp311-cp311-win32.whl (309.3 kB view details)

Uploaded CPython 3.11Windows x86

zlgcan-0.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp310-cp310-win_amd64.whl (315.5 kB view details)

Uploaded CPython 3.10Windows x86-64

zlgcan-0.1.11-cp310-cp310-win32.whl (309.1 kB view details)

Uploaded CPython 3.10Windows x86

zlgcan-0.1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp39-cp39-win_amd64.whl (316.5 kB view details)

Uploaded CPython 3.9Windows x86-64

zlgcan-0.1.11-cp39-cp39-win32.whl (309.2 kB view details)

Uploaded CPython 3.9Windows x86

zlgcan-0.1.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

zlgcan-0.1.11-cp38-cp38-win_amd64.whl (316.3 kB view details)

Uploaded CPython 3.8Windows x86-64

zlgcan-0.1.11-cp38-cp38-win32.whl (309.5 kB view details)

Uploaded CPython 3.8Windows x86

zlgcan-0.1.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

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

File metadata

  • Download URL: zlgcan-0.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 a9a6a95d876ac8ee2c7fa29a57a0338c2605e01f75a40a66dcf4ed03bbcbb458
MD5 53d835761fbd98bd672563de9ba6cd62
BLAKE2b-256 bcc269a2fd6129cc6f45de3d099dad61d0f7981433147ad756d6802ae0ea276f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ab2637c8998a8308f270dc8a19889ca12c12d6e852bc05d1f4aaf66a5eeee67d
MD5 514b0239d9b6a1b2efe106f37fc0aa49
BLAKE2b-256 4f71b36592df54df0d470bba29dbd14dec605a35234711162d2fb4bac326d488

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7a3811c9f39b9bba72a603f8067f4e6e716b335ebd1a091561eb71d09ec5b36
MD5 4d98f7dbd573bf7d1d3481d3182f852f
BLAKE2b-256 3c3c4e48aa69b6212956fb7d51101f700e17598dd683ebf9083dbba0dd8a062a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 315.6 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.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 57598939f4ed0c0b9d99736c29c064f3d2de228790c20773e6559e05940ac5e9
MD5 8adbdf8b22a935b0f9443eef3c64f282
BLAKE2b-256 6bca66a5a146c0643590d1e95ff55435a1146b7691ac09ebcd721967a4bde52a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp312-cp312-win32.whl
  • Upload date:
  • Size: 308.2 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.11-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 5b75dafa49bbed664001f94d2d6c2e6b88251f4fb65edb610dbf86797319ba8b
MD5 1097e38df17cceb7bc5e2569ffea47ef
BLAKE2b-256 6a601d9b446a1896b8ce972bcaca9dd2b5443dea935bb474f04c361bb00e4590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5e952bb14579a3b9a8e11ada23ba631db4865a15334e25ee6e4f55534b226d1
MD5 89e28c28b3a8cc5ee7ed43e6f7fb6ab7
BLAKE2b-256 301dc09cbae82fd05f7787090dab9f0b924fcf395f98b7c479cbcf47dee4f5bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 315.7 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.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ca1644194f570943c9902297848d48b10c6be7f805fd88740f6da421ddc37dbf
MD5 37db203819cdc203790a12d84c20dff9
BLAKE2b-256 843a708bd919959d831158067019eade2be7307e16d0edc5b49607cc326034d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp311-cp311-win32.whl
  • Upload date:
  • Size: 309.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.11-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 28e1b0cedd97ed2f5fb8a571e0802045d3aa9ed2bf0f7ade1a828ba352f3881f
MD5 2b75b88e7f73b65e7dc6fe7009f8f455
BLAKE2b-256 6435ce674639842a2cd230ec2032f8333b542aa86dd0c709c57874c7dbf816bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1da0849adf78f852659ee5978a57378015c6386bc2959ad1fca99fb08b799dc7
MD5 25fceb98c05c5f098cc4203ab9c5bb5b
BLAKE2b-256 89558b4c44499b56ac9ee3cb27ea23b94062327b3ea569da032386fcd7b5ce79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-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.8.1

File hashes

Hashes for zlgcan-0.1.11-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 772629de193c87dc1feacbc5c15f6a5682e2516f678e09cc8a2544d6e278015e
MD5 7d4268f3d7598feae8e59afe8e5ba087
BLAKE2b-256 fb9bd72d0613039451917c3c8e8ad03aea9383834acea9da23adedceff7d0776

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp310-cp310-win32.whl
  • Upload date:
  • Size: 309.1 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.11-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 df85aa3aee3a07e84506bd9cb5df9e4a8203ad55cd2f26e1bdd9728415400b22
MD5 9b43db95a7e3597d67c5b606aab5cfc4
BLAKE2b-256 4588bba69f4eef84d709b4bc069947a32ddfa3c853a36136cc26f99b8df56bf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d3d0b5dd70d3af9615213eb22de6d430ceb3a6f69f1471a299f9030c4a2a944
MD5 06b9603d36a424d4cddb85e7624ded5d
BLAKE2b-256 d5e2d9a083e46c6821fb84386a1629b0ec47ce7a90bfe6b89cfa144a310753b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 316.5 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.11-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 607ea29a73cf46a54bded61603229bdb9ee0c45b3e954fd64ad42f928b342c83
MD5 10cd7aa96a5f75a9dc6f799f8535e940
BLAKE2b-256 3b066dc2652b7ca6fe5afb55b3afb0c6462e7b43be978e74a4896fd88cb9d373

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-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.8.1

File hashes

Hashes for zlgcan-0.1.11-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 0c74616801557779ab54ebbe8b99107d2c2124a959bf64ca265148a551d790c9
MD5 9a513d69839cd5db67fd518f666c20d2
BLAKE2b-256 0cd098c55fbe4bb29fbbe9ea6eb9b5f541bf0a2331aef8be5898ba8ad578d4e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2e20c5bf277aa82cc99b938cff2921a2872557bb9ac3555dcc5580c2e1d6ee4
MD5 7338211c888fe8ed9d8b3629bb2fbc51
BLAKE2b-256 cd28f2baf7966a8c2883f48fdd5adb7a5704aaf84aff29f42f0ab1c969e0a7cf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 316.3 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.11-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ecac0b7b7306d84d3744a70c45dca336543b6433b588f9245b1da167ee3ad499
MD5 ee92c72aa56bd65f94df3e7c39cf889b
BLAKE2b-256 fe110852a4c508b2a56e4fbf508456fb1d14c1dce3f56984bbbcee9717d82d2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.11-cp38-cp38-win32.whl
  • Upload date:
  • Size: 309.5 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.11-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 b9c070d9fbb9225bcb934291876d0883fb88a5741aef6ff3ccd68952ef4f2d74
MD5 d7e8fab8cc274b55ef083354ee01efac
BLAKE2b-256 1aae42649fcbd76fce13c092af533d19a80a9ecdb9a1b3995577447ea136fa4e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 770b0918299407c2b7f6dfdb2026b854169575d2e77f4c668bf11c72f43fb03b
MD5 1172b2111121b374460474d410f35856
BLAKE2b-256 4df926b6952e7f77455cfc532d32fbd7a746280f55fed24d09ff9c2c261675bc

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