<p align="center">
<img src="https://raw.githubusercontent.com/X2Cscope/pyx2cscope/develop/pyx2cscope/gui/img/pyx2cscope.jpg?token=GHSAT0AAAAAACGXT7TPLZREQNFPHPTGHAVEZHIPUNQ" alt="pyX2Cscope Logo" width="250">
</p>
# 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/](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
```py
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)
```
Further [Examples](https://github.com/X2Cscope/pyx2cscope/tree/main/pyx2cscope/examples) directory in the pyX2Cscope project to check out the available examples or create a new .py file according to your requirements.
## Development
[https://github.com/X2Cscope/pyx2cscope/tree/main/doc/development.md](https://github.com/X2Cscope/pyx2cscope/tree/main/doc/development.md)
Raw data
{
"_id": null,
"home_page": "https://x2cscope.github.io/",
"name": "pyx2cscope",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Yash Agarwal",
"author_email": "yash.agarwal@microchip.com",
"download_url": "https://files.pythonhosted.org/packages/2b/14/ed884f02bf703e7bc95b64d4fc9cbbd5bd7e0d69e0ceb866c0463e54dbf4/pyx2cscope-0.4.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img src=\"https://raw.githubusercontent.com/X2Cscope/pyx2cscope/develop/pyx2cscope/gui/img/pyx2cscope.jpg?token=GHSAT0AAAAAACGXT7TPLZREQNFPHPTGHAVEZHIPUNQ\" alt=\"pyX2Cscope Logo\" width=\"250\">\n</p>\n\n# pyX2Cscope\nThe pyx2cscope Python package communicates with X2Cscope enabled firmwares running on microcontrollers. Focusing real time control applications like motor control and power conversion.\n- It allows user to:\n - Read - Write variables to the embedded target in runtime\n - Record and Plot fast, continuous signals from the target firmware\n - Implement Automated Unit Tests (TDD) and HIL tests for embedded development\n - Record data in run-time for AI models\n - Implement custom user interface, dashboards for embedded applications (QT, Tkinter, Web)\n\nDetailed documentation is hosted at GitHub.io:\n[https://x2cscope.github.io/pyx2cscope/](https://x2cscope.github.io/pyx2cscope/)\n\n## Install\n\nCreate a virtual environment and install pyx2cscope using the following commands (Windows):\n```\npython -m venv .venv\n.venv\\Scripts\\activate\npip install pyx2cscope\n```\n\n## Start GUI\n\nTo execute Qt version, type:\n```\n pyx2cscope\n```\nTo execute the Browser based version type:\n\n```\n pyx2cscope -w\n```\n\n## Basic scripting\n\n```py\nfrom pyx2cscope.x2cscope import X2CScope\n\n# initialize the X2CScope class with serial port, by default baud rate is 115200\nx2c_scope = X2CScope(port=\"COM8\")\n# instead of loading directly the elf file, we can import it after instantiating the X2CScope class\nx2c_scope.import_variables(r\"..\\..\\tests\\data\\qspin_foc_same54.elf\")\n\n# Collect some variables.\nspeed_reference = x2c_scope.get_variable(\"motor.apiData.velocityReference\")\nspeed_measured = x2c_scope.get_variable(\"motor.apiData.velocityMeasured\")\n\n# Read the value of the \"motor.apiData.velocityMeasured\" variable from the target\nprint(speed_measured.get_value())\n# Write a new value to the \"motor.apiData.velocityReference\" variable on the target\nspeed_reference.set_value(1000)\n```\n\nFurther [Examples](https://github.com/X2Cscope/pyx2cscope/tree/main/pyx2cscope/examples) directory in the pyX2Cscope project to check out the available examples or create a new .py file according to your requirements.\n\n## Development\n\n[https://github.com/X2Cscope/pyx2cscope/tree/main/doc/development.md](https://github.com/X2Cscope/pyx2cscope/tree/main/doc/development.md)\n\n",
"bugtrack_url": null,
"license": "Proprietary",
"summary": "python implementation of X2Cscope",
"version": "0.4.0",
"project_urls": {
"Documentation": "https://x2cscope.github.io/pyx2cscope",
"Homepage": "https://x2cscope.github.io/",
"Repository": "https://github.com/X2Cscope/pyx2cscope"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "172aba4b2b2299c2a2248a5e1fd84695c9020849877c78d1caa08adfa2144be0",
"md5": "e7410fc7d1f4898c184484fdf75c4faf",
"sha256": "d9e07024ae9b188c24134e12ebe00cdb683f8d67024c18f98e2441290dada980"
},
"downloads": -1,
"filename": "pyx2cscope-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e7410fc7d1f4898c184484fdf75c4faf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 598118,
"upload_time": "2024-12-12T11:40:55",
"upload_time_iso_8601": "2024-12-12T11:40:55.231400Z",
"url": "https://files.pythonhosted.org/packages/17/2a/ba4b2b2299c2a2248a5e1fd84695c9020849877c78d1caa08adfa2144be0/pyx2cscope-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2b14ed884f02bf703e7bc95b64d4fc9cbbd5bd7e0d69e0ceb866c0463e54dbf4",
"md5": "25634d3c416306abc5751b4a4993452a",
"sha256": "c9baad2ca77f49472d2152946ad4f07f5690ca47dddf472f2a708cf1b13e0c04"
},
"downloads": -1,
"filename": "pyx2cscope-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "25634d3c416306abc5751b4a4993452a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 576625,
"upload_time": "2024-12-12T11:40:59",
"upload_time_iso_8601": "2024-12-12T11:40:59.571230Z",
"url": "https://files.pythonhosted.org/packages/2b/14/ed884f02bf703e7bc95b64d4fc9cbbd5bd7e0d69e0ceb866c0463e54dbf4/pyx2cscope-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 11:40:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "X2Cscope",
"github_project": "pyx2cscope",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pyx2cscope"
}