Real-Time Workshop User's Guide | ![]() ![]() |
Choosing a Code Format for Your Application
Your choice of code format is the most important code generation option. The code format specifies the overall framework of the generated code and determines its style.
When you choose a target, you implicitly choose a code format. Typically, the system target file will specify the code format by assigning the TLC variable CodeFormat. The following example is from ert.tlc
.
%assign CodeFormat = "Embedded-C"
If the system target file does not assign CodeFormat, the default is RealTime
(as in grt.tlc
).
If you are developing a custom target, you must consider which code format is best for your application and assign CodeFormat accordingly.
Choose the real-time or real-time malloc
code format for rapid prototyping. If your application does not have significant restrictions in code size, memory usage, or stack usage, you may want to continue using the generic real-time (GRT) target throughout development. The real-time format is the most comprehensive code format and supports almost all the built-in blocks.
If your application demands that you limit source code size, memory usage, or maintain a simple call structure, then you should choose the Real-Time Workshop Embedded Coder target, which uses the embedded C format.
Finally, you should choose the S-function format if you are not concerned about RAM and ROM usage and want to:
.dll
or MEX-file objectTable 4-1 summarizes the various options available for each code format/target available in the Real-Time Workshop.
![]() | Introduction | Real-Time Code Format | ![]() |