xPC Target | ![]() ![]() |
Use the Asynchronous Rate Transition block to double buffer data between the function call subsystem and the rest of the model which executes rate-monotonically in real-time.
Normally, the interrupt service routine writes to the first buffer. When the next model step executes, the first buffer is copied to the second buffer and its value is used for model calculations.
If a second interrupt occurs while the buffer is being copied, data is corrupted. This corruption happens when part of the data is copied from the first buffer, the interrupt occurs and writes over the entire first buffer, and then the transition block continues the copy operation from the first buffer that now has data from the second interrupt.
To prevent possible data corruption, use Async Buffer Write and Read blocks. See Async Buffer Write and Read Blocks.
Block Parameters |
Description |
Sample time |
Enter a base sample time or a multiple of the base sample time. |
![]() | Async IRQ Source Block | Async Buffer Write and Read Blocks | ![]() |