How to detect the simulation start command (Run Button of a model) for inserting user commands before the 'SimulationStatus' takes the value 'start'?

2 ビュー (過去 30 日間)
Hi,
In a design with multiple Xilinx simulation muxes, there is a need to make the right selection of a circuit dedicated for the simulation purpose. To do so, a verification that all muxes must be set to the "Simulation representative circuit" has to be done before the get_param(gcs, 'SimulationStatus') = 'start'.
Is there a function / m-script associated to the 'Run button' (or Menu-> Simulation-> Run or CTRL+T) that can be edited for inserting user commands before the simulation start? Or any GUI tag from the model windows that can be read?
Thanks for your help,
Richard

回答 (1 件)

Muthu Annamalai
Muthu Annamalai 2015 年 7 月 27 日
Hello Richard,
I assume you want to modify properties of a block on 'initialization of simulation'.
You have callbacks on various blocks which can be accessed by right-click "Block properties" and under callback functions.
Adding respective block property set/get parameters will enable you to control pre-simulation/post and during simulation actions.
For example the following shows how to add a callback for MaskInit http://www.mathworks.com/help/xpc/driver/create-initialization-callback.html
  2 件のコメント
Richard Bourque
Richard Bourque 2015 年 8 月 3 日
Hi,
With R2011b everything is fine.
However with Matlab/Simulink of version R2014b there is no call of the callback functions (StartFcn()) when the "Run button" is pressed. Neither update diagram is calling the InitFcn().
Is there an option somewhere to be activated?
Best regards,
Richard
Richard Bourque
Richard Bourque 2015 年 8 月 4 日
Hi,
These observations have been based with the use of "disp('Message')", but it is ignored when pressing the "Run button". With the use of "errordlg('Message')" I can see the appropriate callback execution.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModel, Block, and Port Callbacks についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by