Deploy Generated Component Software to Application Target Platforms
The code generator supports integration of generated code with operating systems and processors. For details, see Embedded Coder Supported Hardware.
Interface to an Example Real-Time Multitasking System
This example shows how to simulate and generate code for asynchronous events on a real-time multitasking system.
The operating system integration techniques that the example demonstrates use one or more blocks in the
vxlib1 library. These blocks provide starting point examples to help you develop custom blocks for your target environment.
model = 'OSIntegration'; open_system(model);
The example model contains two asynchronously executed subsystems,
Count executes at interrupt level.
Algorithm executes in an asynchronous task. The generated code for these blocks is tailored for the VxWorks® operating system. However, you can modify the
Async Interrupt and
Task Sync blocks to generate code for your run-time environment whether you are using an operating system or not.
Data Transfer Assumptions
This example assumes the following about the target platform environment:
Data transitions occur between a single task that reads data and a single task that writes data.
A read or write of a byte-sized variable is atomic.
When two tasks interact during a data transfer, only one of the tasks can preempt the other task.
For periodic tasks, the task that executes at the faster rate has a higher priority than the tasks that executes at the slower rate. The task executing at the faster rate preempts the tasks executing at the slower rate.
Tasks run on a single processor. Time slicing is not allowed.
Processes do not crash and restart during a data transfers.