real-凯发k8网页登录

main content

real-time execution in run in kernel mode

the run in kernel mode is a higher-performance alternative to . in run in kernel mode, you use simulink® coder™ to link generated algorithm code to i/o driver code generated from the i/o blocks. the resulting executable runs in operating system kernel mode on the development computer. the executable exchanges parameter data with simulink through a shared memory interface.

  • signal acquisition — you can capture and display signals from your real-time application while it is running. signal data is retrieved from the real-time application and displayed in the same simulink scope blocks that you used for simulating your model.

  • parameter tuning — you can change parameters in your simulink block diagram and have the new parameters passed automatically to the real-time application. external mode changes parameters in your real-time application while it is running in real time.

the run in kernel mode executable is fully synchronized with the real-time clock. the main role of simulink is to read and display simulation results returned from the executable.

procedures related to real-time execution in run in kernel mode include:

note

use a fixed-step solver in run in kernel mode.

image of external mode simulation architecture

in run in kernel mode, the real-time application and the i/o drivers run in the kernel mode process. using the i/o drivers to communicate with the hardware, the application stores contiguous response data in memory accessible to simulink until a data buffer is filled. when the buffer is filled, the real-time application continues to run while simulink transfers the data to the matlab® environment through simulink external mode. transfer of data is less critical than maintaining deterministic real-time updates at the required sample interval. after model computations are finished, data transfer runs at a lower priority while the process waits for another interrupt to trigger the next model update.

data captured within one buffer is contiguous. when a buffer of data has been transferred, the data is immediately plotted in a simulink scope block. you can save the data directly to a mat-file by using data archiving in simulink external mode.

with data archiving, you can save each buffer of data to its own mat-file. the mat-file names can be automatically incremented, enabling you to capture and store many data buffers. although points within a buffer are contiguous, the time required to transfer data back to simulink pauses data collection until the entire buffer has been transferred. this pause can result in lost sample points between data buffers.

related topics

网站地图