User`s guide
12 Configuring Real-Time Workshop for Your Application
12-6
generator to properly specify the rate at which f() should be executed as shown
in the
connected_trigger model below.
Instead of the function-call generator, you could have any other block that can
drive the trigger port. Then, you should call the model’s main entry point to
execute the trigger function.
For multirate models, a common use of the Real-Time Workshop is to build
individual models separately and then hand-code the I/O between the models.
This approach places the burden of data consistency between models on the
developer. Another approach is to let Simulink and the Real-Time Workshop
ensure data consistency between rates and generate multirate code for use in
a multitasking environment. The Real-Time Workshop Interrupt Template
and VxWorks Support libraries provide blocks which allow synchronous and
asynchronous data flow. For a description of all the Real-Time Workshop
libraries, see Chapter 11, “Real-Time Workshop Libraries.” For more
information on multi-rate code generation, see Chapter 7, “Models with
Multiple Sample Rates.”
Choosing a Code Format for Your Application
There are many options you can choose on the path from a Simulink model to
generated code. Depending on your specific application, settings for these
options significantly influence code generation. The most important option is
the code format, which specifies the overall framework of the generated code
and also determines its style.
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