C-Code Generation

Navigation:  Toolboxes > Real-Time Toolbox > C-Code Generation >

C-Code Generation

Previous pageReturn to chapter overviewNext page

20-sim has a C-Code Generator which automatically converts a complete 20-sim model or submodel into C-Code. The application can be used to generate Matlab™/Simulink™ S-Functions, to generate Stand-Alone executables or to generate input/output functions for use in other C and C++ programs. The ANSI C-Code Generator can be opened from the Simulator (Tools menu, C-Code Generation command).

CCode

Depending on the target selected, 20-sim will generate specific C-code.
You can add more targets by adding paths in the General Properties.

By default, the following targets are supported:

1.20-sim Dynamic DLL: Generate C-code of a 20-sim submodel and compile the code into a DLL-call for use inside 20-sim.
2.20-sim submodel for Arduino/AVR: Generate C-code for the use on a Arduino/AVR. Note: not all functions (e.g. matrix) are supported!
3.C-Code for 20-sim submodel: Generate C-code of a 20-sim submodel.
4.C++ class for 20-sim submodel:  Generate object oriented C-code of a 20-sim submodel.
5.Simulink S-fuction: Generate C-code of a 20-sim submodel in the Simulink format and compile it into an S-fucntion. Note: this option requires the Matlab mex-compiler.
6.Stand-Alone C-code:  Generate C-code of a 20-sim mainmodel including integration method.
7.FMU 1.0 export for 20-sim submodel: Export a 20-sim submodel using the FMI 1.0 standard.
8.FMU 1.0 export for 20-sim submodel: Export a 20-sim submodel using the FMI 2.0 standard.