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

Uploaded PyPymanylinux: glibc 2.17+ x86-64

zlgcan-0.1.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

zlgcan-0.1.12-cp312-cp312-win_amd64.whl (315.7 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12Windows x86

zlgcan-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (497.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11Windows x86

zlgcan-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (498.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10Windows x86

zlgcan-0.1.12-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.12-cp39-cp39-win_amd64.whl (316.6 kB view details)

Uploaded CPython 3.9Windows x86-64

zlgcan-0.1.12-cp39-cp39-win32.whl (309.3 kB view details)

Uploaded CPython 3.9Windows x86

zlgcan-0.1.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (499.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

zlgcan-0.1.12-cp38-cp38-win_amd64.whl (316.4 kB view details)

Uploaded CPython 3.8Windows x86-64

zlgcan-0.1.12-cp38-cp38-win32.whl (309.6 kB view details)

Uploaded CPython 3.8Windows x86

zlgcan-0.1.12-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.12.tar.gz.

File metadata

  • Download URL: zlgcan-0.1.12.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.12.tar.gz
Algorithm Hash digest
SHA256 dafda76cc791c6f33a1400fa057f088a88f6e61d45128c9f6707164b4e020554
MD5 f4143ca2192f8270b4ee432bbf11e66d
BLAKE2b-256 8a3b88d6d20aedbf8db5ae45596100c7db26be4a52c3099a00e45ea8f4a02372

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18d4987df41eb4fb6cf049c1e2c0a66bbe9062273872fbff2a450ac682ec4c03
MD5 871bb488507ed5992b9cf2fcf5c94ac7
BLAKE2b-256 ae41db80f94fe94a50a4ac0289380254668859c0a798d03a90199b2ab48b3b5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 098e048ba1b28f4e724f363dac7750fb5404daf352369a392e5fd9ecc48460ba
MD5 6aadd5c1e4a380e3498587980e61e89b
BLAKE2b-256 bd3cb23be7e3e1418b0c5c982f373899788ea8fde1cf3c2ad952e428f24d7e56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 315.7 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.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5424d871f65395c343280b07efc6304f8303baacdd3b1908a3b61e9f97ea4c16
MD5 5a79d05de8e7defca75c77acfb66e89c
BLAKE2b-256 61200288bb747b75d96e9a23d89f0dfdbe34a07a847d1b30ba95b4db2617659d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-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.12-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 c20449c846a9f0d987ef57c827acaefc39f0d8d51a52c660401303a9fb59144b
MD5 30ee2b17cb5bbafb7c4d424ffc45b911
BLAKE2b-256 0a6ba804ff2ae30f2b9a09f9e1b2d5840230476a47ab49ae6b3010378997821f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 adf5a2d3fc9c8185a3a49076094d63285db9aa6b43b30f54169586f891f58ba3
MD5 070ab4944d22fe04c12a12b02ae0e8c8
BLAKE2b-256 ab00b86b2c568ead88c3ce25ba387887092d1e5756cc30e7350bb4c870dc32a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-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.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60775be3451d1ea8fdaadc0788570a3ced29b70893d1b0e4b38c3ed90de9a249
MD5 583b938163ecbbaaf9d74a32fe792ec6
BLAKE2b-256 95de628078fa9097900f3ec04980a8e2bda117619da97b0867ea1a3a70415dd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-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.12-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 46236a16be6b523c9c9a20c4b06213c86f31128aa86659b13a12ba73e60161fe
MD5 f73f651b900b7c7030f3a4547ec1f418
BLAKE2b-256 1e4960c6057664b0153e8cacfb3085b45c5133de6f9eb005ce3c36ef56f5d928

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0706207485e07056bed51556db0e29de30f4716d24651b7b77735fa18d4c3c26
MD5 8698084af8594f57f6822953200b55e6
BLAKE2b-256 aff1df0f913ae74fe82f1363dab528c0289f73f8c95d01e61b5081b38f897c16

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-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.12-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d685be5ebd2ca542f008cdcc4cf3ef3ee1fc5b7fabf3812ba25ca8e49e436e52
MD5 83c605ff5d60ffc98ad7f1a41600cea1
BLAKE2b-256 582f113b5bb79ea819a63ef2597d8f3cb499b893a548164e5c2479c2801f9f1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-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.12-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 f2664d2350f9cbfeb1b1fbffd2bbfaf59e363d955016705713434177b26d7bb6
MD5 04052ca85729c118c81e6c4b8cd8be58
BLAKE2b-256 d32a5d9bf52ecfc2d56ebaaedb324e15e515f43d6472bb5b8bd6e02a98ce678a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a61455ed5f8ea1e0b69814a5dbeeb7888996540ea6255d1dcf5ecbb0561b72a7
MD5 10473a485d6d5ac527123331a963abde
BLAKE2b-256 b607c928af063d002f8d31fe123ec9d368f1f7541ba815680912ebc6e382ca81

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.12-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 972b4e2841b68e9dc059c241afbfad3af9f02258e384ea78140523b2f4a7d29d
MD5 aa99c4d390839d7c43294531b0a951d9
BLAKE2b-256 560ec6006d27f0149f08cf976aebd253a22f785343ab1606178e56bbcf45d8e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-cp39-cp39-win32.whl
  • Upload date:
  • Size: 309.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.12-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 42245048ce13e9554a4d9d17ac2c4bc0fa8b7ec747f2a267420435fa576aad66
MD5 5f0db2b7ebe07ccc2ad4dde09552aca1
BLAKE2b-256 9e981e55eb3ce87694eab8da2a17bfabd0f4cda07f993365d671ba5a94b5a406

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f6e3b43ee41e71be8643b834495aee98e3b9e9404cd965be699780716378db5e
MD5 bf949cac7545316cf9d5983337f023b8
BLAKE2b-256 f72447f9f24fca4b347ee09bd9bab2aceb6a93e0287769a0d5113181f999f1ee

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for zlgcan-0.1.12-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 53b29d8ed27678f27083b581dbbc4d94d48c8bdef6e506bf1c637de9af0c1925
MD5 824f9426cb13b644d60d93d1cb5f95c2
BLAKE2b-256 54e9a2f43925058eeac285d7dab8bf4ff86d247bd421de1fc159c9d678f6f2bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zlgcan-0.1.12-cp38-cp38-win32.whl
  • Upload date:
  • Size: 309.6 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.12-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 847fb3c6b8061a250fc6489502f2f7e95e19d0662adac66664c5675306044a4c
MD5 4536e70b3b68f0239030634ab7c557ad
BLAKE2b-256 ef69d6c8120f13ec702b15eda222917704c1644dbbd74442810a1ad25a8b26ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zlgcan-0.1.12-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07a568602e83b3267f69663e888f3b3aa146e7287e34f00e594258c59a35b648
MD5 657d67fc5056d30870ff363e7630c49c
BLAKE2b-256 5088d61f460b95c56c4b745473f883990a9f73d669f9a0db114153a7cc43a834

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