Real-Time Windows Target | ![]() ![]() |
Data Buffers and Transferring Data
At each sample interval of the real-time application, Simulink stores contiguous data points in memory until filling a data buffer. Once the data buffer is filled, Simulink suspends data capture while the data is transferred back to MATLAB through Simulink external mode. Your real-time application, however, continues to run. Transfer of data is less critical than maintaining deterministic real-time updates at the selected sample interval. Therefore, data transfer runs at a lower priority in the remaining CPU time after model computations are performed while waiting for another interrupt to trigger the next model update.
Data captured within one buffer is contiguous. When a buffer of data has been transferred to Simulink, it is immediately plotted in a Simulink Scope block, or it can be saved directly to a MAT-file using the data archiving feature of the Simulink external mode.
With data archiving, each buffer of data can be saved to its own MAT-file. The MAT-filenames can be automatically incremented, allowing you to capture and automatically store many data buffers. Although points within a buffer are contiguous, the time required to transfer data back to Simulink forces an intermission for data collection until the entire buffer has been transferred and may result in lost sample points between data buffers.
![]() | Simulink External Mode | Installation and Configuration | ![]() |