C/C++/Java Generator Settings

C/C++/Java Generator Settings

Template File. The template file for code generation. See the Code Generator - General section for an explanation of the template file. The path can be both absolute or relative to the project folder, that is, the folder containing the project file. Click the Browse... button to the right of the field to select the template file using a file dialog.

Output File. The location and name of the file to generate. The path can be both absolute or relative to the project folder, that is, the folder containing the project file. Click the Browse... button to the right of the field to select the location and name using a file dialog.

Sample Time (s). The real time in seconds corresponding to one execution cycle. This setting specifies what the %SAMPLE_TIME% key in the template file will be translated to in the code generation. It also specifies the output value of the Dt block, which is used in the definitions of, among others, the Derivative and the Integral blocks. The value must be greater than 0.

Java Syntax. When checked, Java code will be generated instead of C/C++ code. For example, the call to a sine function will be Math.sin(x) instead of just sin(x).

Generate Comments. When checked, each generated assignment will be followed by a comment that indicates what signals are involved in the operation. As an example, i[1] = i[2] + i[3]; could be followed by /* sum = pre_count + v1; */. While this option makes the generated file bigger, it also makes it a little more human-readable.

Optimize Variables. When checked, the generated code will be optimized. As a consequence, some internal signals may be removed. This means that the caller of the generated code can not assume that all signals in the source files will also exist in the code. However, the input and output signals of the top-level node will always be available.