C Controller - Building

Page / - last modified by Alexander Schulz-Rosengarten on 2023/07/13 12:23

Building

last modified by Alexander Schulz-Rosengarten

on 2023/07/13 12:23

Table of Contents

Building / Make Script

Compilation from SCChart to C-Code

Compilation from C-Code to executable

Building / Make Script

The build process for the controller consists of two main tasks:

Compilation from SCChart to C-Code

The SCCharts for the Controller are compiled by KIELER. This can either be done in the usual GUI Version or with the KIELER Command Line Compiler.

Before trying to run the code the compiler output should be checked. The compiler generates C-Code even if the Controller isn't fully schedulable, so be careful when trying new controllers.

The generated C-Files should be stored in the /code/ part of the local working copy but not commited to the repository.

Compilation from C-Code to executable

To generate the final executable a python script is provided. This can be found at /code/make.py. The script takes care of including the required modules and adds the needed headers to the controller.

Calling the script with the first parameter rail and the path to the C-Code compiles the controller for the real railway installation.

python make.py rail railway/Tests/TestAll.c

With the parameter sim instead of rail the simulation is built.

python make.py sim railway/Tests/TestAll.c

The generated executables are located in the /code/build/ directory. These files should normally not be commited to the repository.

With the second parameter run the code is executed after finishing the compilation.

python make.py sim run railway/Tests/TestAll.c