You can improve run-time performance and reduce the task execution time (TET) of a model by using the following procedures.
Use the following performance tools:
Run Performance Advisor from the Simulink® Analysis > Performance Tools menu and follow its guidance. See:
Configure a real-time application for profiling, run
it, and call
profile_slrt to retrieve
the results. Evaluate the results for potential improvements in the
task and core distribution of the model. See Execution Profiling for Real-Time Applications.
If you are using a single-core target computer, improve performance by configuring your model to run on a multicore target computer:
Acquire a multicore target machine (see www.speedgoat.com/products).
Partition the model into subsystems according to the physical requirements of the system that you are modeling. Set the block sample rates within each subsystem to the slowest rate that meets the physical requirements of the system.
In the Configuration Parameters dialog box, on the Solver pane, select the check box for Treat each discrete rate as a separate task.
Allow tasks to execute concurrently
on target check box.
Click Configure Tasks, and then select the Enable explicit model partitioning for concurrent behavior check box.
Create tasks and triggers, and then explicitly assign subsystem partitions to the tasks (see Partition Your Model Using Explicit Partitioning (Simulink)).
In Simulink Real-Time™ Explorer, on the Target settings pane, check that you selected the Multicore CPU check box.
Run the real-time application on the multicore target machine.
If the model contains many states (for example, more than 20 states), clear the States check box in the Configuration Parameters dialog box, on the Data Import/Export pane. You have now disabled state logging, making more memory available for the real-time application.
On the Data Import/Export pane, clear the Time, States, Output, Final states, and Signal logging parameters. You have now turned off data logging, making more CPU cycles available for calculating the model.
On the Simulink Real-Time Options pane, clear the Monitor Task Execution Time check box. You have now disabled TET logging for the real-time application.
On the Solver pane, increase Fixed-step size (fundamental sample time). Executing with a short sample time can overload the CPU.
Use polling mode (see Polling Mode).
In Simulink Real-Time Explorer, on the Target settings pane, clear the Graphics mode check box to disable the target scope display.
Remove scopes from the model.
Eliminate or minimize target computer disk I/O in your model.
Reduce the number of I/O channels in the model.
For additional guidance, refer to the following sources:
MathWorks® Tech Support:
For Speedgoat hardware issues, contact Speedgoat Tech Support:
If these sources do not solve your issue, contact MathWorks Technical Support. See Find Simulink Real-Time Support.