Simcenter Prescan How to compile an executable and run a Prescan experiment on Windows without Matlab/Simulink and Prescan. (Works version 2022.1 and upwards)

2022-03-08T08:55:34.000-0500
Prescan Teamcenter Share Simcenter Prescan Marketing

Summary

Generating executable for running on Windows or Linux for Prescan version starting from 2022.1 (not older version)


Details

Software needed:
Simcenter Prescan
Matlab Simulink with C++ compiler (Visual studio)
Cmake 3.21 and higher https://cmake.org/download/



First step is to create an experiment with the Prescan GUI and to start Matlab.  Open the Simulink model for generating code for Windows or Linux.
Click on the Prescan tab on the Simulink Model and click on Generate code for Target. A window will pop up for some settings. In here it is only needed to choose for which target code should be generated. Windows, Linux, or other hardware. In this case the process is shown for Windows. Click on build. In the Matlab command section you can see if the build process was successful or aborted.


User-added image

After building the experiment, a zip file will be created in the folder of the experiment. You can now use this zip file which also contains the experiment and more data for generating an executable to run it locally or on other machines on which a Prescan installation is available. There is no need to run prescan. It is needed for the license.

The next step is to set the installation path to the .exe of Cmake to be able to use the Prescan Shell commands as shown in the next picture.
Search in Windows for “Environment variables”. A window as following opens. Click on environment variables for the next window.
Search under “the system variables” for “path” and double click it. Another windows opens where the path to the executable needs to be added to the end of the “variable value” in this format ;installation path;
Save the settings and it is done.

User-added imageUser-added image


Next step is to start the Prescan Process Manager and start Prescan Shell. After starting, it needs to be configured to use the visual studio compiler like in the next picture. Copy this line and press enter: C:\apps\MVS14\VC\vcvarsall.bat amd64

User-added image


Now unzip the experiment and change change the directory in the Shell command window to the unzipped experiment folder, where the generated data is (cd is the command to change directory).
cd <experiment name>/<model name>_<target version>_rtw
In this example it is C:\Users\tasolb\Desktop\Cloudtest\Cloudtest_cs_psv2_rtw .

User-added image

Once the directory is changed use the Prescan shell command “prescanbuild”. After using this an executable with the experiment name is generated  in the experiment folder.

User-added image


Now change the directory to the following: > cd <path to experiment folder>. This is the folder where the .exe file is generated.
In this case it is   
C:\Users\tasolb\Desktop\Cloudtest

For running us the command “prescanrun” in the following way:
Prescanrun modelname.exe for this example prescanrun cloudtest_cs.exe

User-added image

 

KB Article ID# KB000049087_EN_US

Contents

SummaryDetails

Associated Components

Documentation Installer License Software