Skip to main content

Pythonic wrapper around the VECTOR CANape API

Project description

pyCANape

PyPI - Version PyPI - Python Version Documentation Status

This is a pythonic wrapper around the VECTOR CANape API. The documentation is available here.

Example usage

Open and close CANape

import pycanape

canape = pycanape.CANape(
    project_path="C:\\Users\\Public\\Documents\\Vector CANape 17\\Examples\\XCPDemo",
    modal_mode=True,
)
canape.exit(close_canape=True)

Create Module

from pycanape import DriverType, Channels

# Create XCPsim module
xcpsim = canape.create_module(
    module_name="XCPSim",
    database_filename=r"C:\Users\Public\Documents\Vector CANape 17\Examples\XCPDemo\XCPsim.a2l",
    driver=DriverType.ASAP3_DRIVER_XCP,
    channel=Channels.DEV_CAN1,
    go_online=True,
)

Calibration

# get scalar (0D) calibration object
scalar_obj = xcpsim.get_calibration_object("map1Counter")

# read scalar value
print(scalar_obj.value)

# set scalar value
scalar_obj.value = 2.0

# get axis (1D) calibration object
axis_obj = xcpsim.get_calibration_object("Curve1")

# read axis length
axis_dim = axis_obj.dimension

# read axis values
print(axis_obj.axis)

# set axis values
axis_obj.axis = [0] * axis_dim

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

pyCANape-0.5.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

pyCANape-0.5.0-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file pyCANape-0.5.0.tar.gz.

File metadata

  • Download URL: pyCANape-0.5.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for pyCANape-0.5.0.tar.gz
Algorithm Hash digest
SHA256 518a75112ec84144a1bb3fcb8848af5b47191013b26defedc744a99a6a645949
MD5 624c314b8a9e824c5c54749e321b2e0e
BLAKE2b-256 83251151dd0b83f0d2398228ad85ed81a1cab4d175869fe402d2f410635c3cbb

See more details on using hashes here.

File details

Details for the file pyCANape-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pyCANape-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 30.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for pyCANape-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2acbfee7418b34dfcb5f44c30035b93b40bd08d9cf126557c1ee623880e30020
MD5 ea0c5f8102e5cce7c697a4c0ed5377e4
BLAKE2b-256 0c932b537da93ec27cc676b1460fa0886fb2e9840d8e74f4e91431ce11b2aeda

See more details on using hashes here.

Supported by

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