Skip to main content

python implementation of X2Cscope

Project description

pyX2Cscope Logo

pyX2Cscope

The pyx2cscope Python package communicates with X2Cscope enabled firmwares running on microcontrollers. Focusing real time control applications like motor control and power conversion.

  • It allows user to:
    • Read - Write variables to the embedded target in runtime
    • Record and Plot fast, continuous signals from the target firmware
    • Implement Automated Unit Tests (TDD) and HIL tests for embedded development
    • Record data in run-time for AI models
    • Implement custom user interface, dashboards for embedded applications (QT, Tkinter, Web)

Detailed documentation is hosted at GitHub.io: https://x2cscope.github.io/pyx2cscope/

Install

Create a virtual environment and install pyx2cscope using the following commands (Windows):

python -m venv .venv
.venv\Scripts\activate
pip install pyx2cscope

Start GUI

To execute Qt version, type:

   pyx2cscope

To execute the Browser based version type:

   pyx2cscope -w

Basic scripting

from pyx2cscope.x2cscope import X2CScope

# initialize the X2CScope class with serial port, by default baud rate is 115200
x2c_scope = X2CScope(port="COM8")
# instead of loading directly the elf file, we can import it after instantiating the X2CScope class
x2c_scope.import_variables(r"..\..\tests\data\qspin_foc_same54.elf")

# Collect some variables.
speed_reference = x2c_scope.get_variable("motor.apiData.velocityReference")
speed_measured = x2c_scope.get_variable("motor.apiData.velocityMeasured")

# Read the value of the "motor.apiData.velocityMeasured" variable from the target
print(speed_measured.get_value())
# Write a new value to the "motor.apiData.velocityReference" variable on the target
speed_reference.set_value(1000)

Check Examples directory in the pyX2Cscope project to see common uses of this library.

Development

https://github.com/X2Cscope/pyx2cscope/tree/main/doc/development.md

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

pyx2cscope-0.5.1.tar.gz (634.5 kB view details)

Uploaded Source

Built Distribution

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

pyx2cscope-0.5.1-py3-none-any.whl (658.4 kB view details)

Uploaded Python 3

File details

Details for the file pyx2cscope-0.5.1.tar.gz.

File metadata

  • Download URL: pyx2cscope-0.5.1.tar.gz
  • Upload date:
  • Size: 634.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for pyx2cscope-0.5.1.tar.gz
Algorithm Hash digest
SHA256 3aee30dd6de52f01e7648279f7f9b085fe1a723c938caf2bcefa0d091b355753
MD5 a90ab1b76b54f12e97fcbb4852f7bc5a
BLAKE2b-256 9d5f4f32f9c46890eb346646595d0368c08bf7f0bc7ca1aee7b78aa632e7770c

See more details on using hashes here.

File details

Details for the file pyx2cscope-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pyx2cscope-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 658.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for pyx2cscope-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5666bc302246735361fbfbba6da3d8f370ffa716d29a8397f394ac4dd3a7a19
MD5 bc1f3a1e115dd693b23b63e5678f41c8
BLAKE2b-256 5aa8ae22509230d9ab4b0c1c466f86605c7a2873f515980c3279b6d694544492

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