Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
Related Components
Details and interaction
The RT-LAB API provides a standard interface to interact with RT-LAB. The API is available in several programming languages. However, the API is written in C code and any language that supports C-function calls may interface with the RT-LAB API.
The RT-LAB API interacts with RT-LAB objects through the Controller process. Many APIs may interface through the same Controller concurrently. The Controller will manage all the commands sent to the model and values received from the model.
Which Python File to import?
Every file related to the Python API may be found in the following folder: <RTLAB_ROOT>/common/python/
. From there, two main Python files are listed:
RtlabApi.py
: This is the module users should work with when creating Python scripts. It serves as the main interface to the API.OpalApiPy.py
: This is a legacy module used internally byRtlabApi.py
and should not be called directly by users. For very old versions of RT-LAB, it used to be the API’s main entry point and is still available for backward compatibility, but users should now consider it obsolete and use RtlabApi.py instead.
For details about Python versions supported, refer to the following page: RT-LAB: Software Compatibility | Python compatibility
Starting RT-LAB (and more specifically, starting the MetaController process) sets the PYTHONPATH
to the corresponding RT-LAB’s Python folders.
In summary, in order to use the RT-LAB’s Python API, RtlabApi.py
is the file to be imported in scripts. It will match the version of the last RT-LAB version started.
Example:
Import RtlabApi
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter