- Redesign the model such that the pace will depend upon set parameters.
- Write a script that takes pacing as input, programmatically modifies the model parameters, and generates code for the updated model.
Pacer in the codegen Executable
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I used to use the Set Pace block in the Aerospace Blockset for pilot in the loop simulation and use Simulink coder to generate a .exe file. The .exe can run in real-time as a standalone software without Matlab installed. Mathworks seems to block such function with latest Simulink Coder. The coder will ignor the pace block.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1094645/image.png)
Is there any alternative way to generate an .exe with real-time pace?
Thanks!
0 commentaires
Réponses (1)
Infinite_king
le 15 Déc 2023
Modifié(e) : Infinite_king
le 15 Déc 2023
Hi Oliver Ouyang,
I understand that you are looking for a block which has same functionality as ‘Set Pace’ or ‘Simulation pace’ block with the support of code generation.
The “Simulation Pace” block is not suitable for deployment, therefore, it will not generate deployable code. The “Simulation Pace” block allows you to slow down the pace of model simulation, enabling a more comfortable observation of connected animations and a clearer understanding of system behaviour. Slowing down the simulation rate facilitates a better grasp of the underlying system design, identification of design issues, and the demonstration of near real-time behaviour. It provides the ability to view results and inspect your system dynamically while the simulation is ongoing.
This block is particularly useful in situations where one simulated second corresponds to completion in a few milliseconds of wall clock time. While simulating, you can continue to utilize this feature through the 'Simulation Pacing Options.' For more details, please refer to the MATLAB documentation at, https://www.mathworks.com/help/simulink/slref/simulationpacingoptions.html?s_tid=srchtitle_site_search_2_set%20pace%20block
To achieve this behaviour in the executable, one possible approach I can suggest involves two steps:
For more information on setting the parameters programmatically, refer the following MATLAB documentation,
For more information on generating code, refer the following MATLAB documentation,
Hope this is helpful.
0 commentaires
Voir également
Catégories
En savoir plus sur Event Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!