Support : Knowledge base

Knowledge Base

Welcome to OPAL-RT’s Knowledge Base

OPAL-RT offers a repository of support information for optimal use of its technology.

Loading…

Please note that OPAL-RT knowledge base is not fully optimized for mobile platforms.

For optimal experience, use a desktop computer.

Reference Number: AA-01547// Views: AA-01547// Created: 2018-10-18 16:49:30// Last Updated: 2021-10-25 20:23:59
HowTo
How To Use the Python script in TestDrive with RT-LAB 11.X

How To Use the Python script in TestDrive with RT-LAB 11.X

If you have used the Python script in TestDrive with a version of RT-LAB 10.X, it will probably not work as expected in RT-LAB 11.X.

Since RT-LAB 11.X they are some changes in the definition of the environment variable that doesn't allow you to use the script in TestDrive straight away.

In order to work again with Python in TestDrive in RT-LAB 11.X you need to follow the two next steps:


1- Installation of the correct version of Pyhton

If you haven't worked with Python and TestDrive previously you might need to install a version of Python that is compatible with RT-LAB.

TestDrive is compatible with the following version of Python: 2.6, 2.4 and 2.2.

In order to simplify the installation, you will find in our ftp the two files that you will need to install in order to have a compatible version of Python. Here the ftp link for the Python installation:

Python Files

You will need to install the following file:

o   python-2.6.6.msi

o   pywin32-219.win32-py2.6.exe

2- Correction of the environment variables system

Starting RT-LAB 11.X the variables RTLAB_ROOT and PYTHONPATH that are present in USER environment variable are not copied in the SYSTEM environment variable at the opening of RT-LAB/Metacontroller. These variables need to be defined in the SYSTEM variables also in order for the Python script to work in TestDrive.

To simplify this process we have created a batch file that reconfigures automatically the variable correctly and launches after TestDrive. The batch file is in the attached file of this article you will need to execute it in ADMIN MODEWe strongly recommend using this script instead of reconfiguring manually the variables.

So once you have open the metacontroller, you can launch the batch file in order to open TestDrive.

You can verify once TestDrive is open that you have in your SYSTEM environement variable the following variables in SYSTEM:

PYTHONPATH = c:\opal-rt\rt-lab\v11.X.X.XX\common\python;c:\opal-rt\rt-lab\v11.X.X.XX\common\bin;

RTLAB_ROOT = C:\OPAL-RT\RT-LAB\v11.3.1.34




Once you have done both steps you can run properly a Python script in TestDrivein with a 11.X version of RT-LAB.

If after following these steps, you still encounter some issue please contact support at http://www.opal-rt.com/contact-technical-support/


TestDrive+for+Scripts.bat 107 b 107 b