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).

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-function: Generate C-code of a 20-sim submodel in the Simulink format and compile it into an S-function. Note: this option requires the Matlab mex-compiler. |
6. | Stand-alone C-code: Generate C-code of a 20-sim main model including integration method. |