Getting started#
Installation#
PyScadeOne is compatible with any Python version strictly greater than Python 3.9. It has been tested with Python 3.12. It can be found on PyPi and it also distributed as a wheel package with the Scade One tool.
To install PyScadeOne use the command:
pip install ansys-scadeone-core
Note
PyScadeOne comes with two (2) sets of package dependencies:
Direct dependencies are the packages that PyScadeOne directly relies on, with their minimum required versions. This is the default installation mode.
Frozen dependencies include both the direct and indirect packages that PyScadeOne depends on, with their exact versions. This is an optional installation mode. Frozen dependencies are useful when you want to install the exact versions of the dependencies that PyScadeOne was tested and validated with.
To install PyScadeOne with the frozen dependencies, use the command:
pip install ansys-scadeone-core[frozen-dependencies]
The installation may fail if the exact version of a frozen dependency is not compatible with a version in the Python environment. A virtual environment is recommended to avoid conflicts.
You may want to install PyScadeOne in a Python virtual environment. Please look at the Python venv module.
Requirements#
PyScadeOne requires .NET Runtime 8 on your host. Please look at dotnet and at the installation scripts.
PyScadeOne uses the following .NET libraries:
FsYaccFsLex, required for the Swan language parser
FSharp, required for the Swan language parser
The required DLLs are delivered with PyScadeOne.
Supported versions#
The versions for the supported format/code are:
Graphical information format: 2.0
Simulation data format: 1.1
Project jobs: 2.1
Scade One project: 1.0
Swan language version: 2025.1
Swan Test Harness: 1.1
Test results format: 1.0
PyScadeOne Wrapper: 1.0
Quick start#
Here is a small script showing how to load a Scade One project and get its model.
from ansys.scadeone.core import ScadeOne
my_project = "some_project.sproj"
with ScadeOne() as app:
# load a project
project = app.load_project(my_project)
# explore project resources: dependencies, files, ...
swan_model = project.model
# do something nice with the swan model
More details can be found in Modeler section, and in API sections.
Limitations#
The Python wrapper support:
Two sensors with the same name in different modules cannot be correctly generated.
Linux is not supported.
Swan language support:
The n-ary lxor operator is not supported.
The optional luid of a diagram construct is ignored.