This model shows how to simulate and generate code for asynchronous events on a real-time multitasking system.
Open the example model
The two asynchronous events,
Interrupt2, are executed in the referenced model via two different function-call input ports. The code generated for these blocks is specifically tailored for the VxWorks® operating system. However, you can modify the Async Interrupt block to generate code specific to your environment whether or not you are using an operating system.
Basis of operation for data transfers between tasks:
Data transitions occur between a single reading task and a single writing task.
A read or write of a byte sized variable is atomic.
When two tasks interact through a data transition, only one of them can preempt the other.
For periodic tasks, the faster rate task has higher priority than the slower rate task; the faster rate task always preempts the slower rate task.
All tasks run on a single processor. Time slicing is not allowed.
Processes do not crash/restart (especially while data is being transferred between tasks)