How do i pause every iteration in a for iteration subsystem for a specified amount of time?
1 回表示 (過去 30 日間)
古いコメントを表示
For the simulink external mode setting, i am planning to design a simulink model that is equivalent to:
for i = 1:16
for j = 1:16
......configure multiplexers......................
......read some data from sensors that have refresh rate of 0.02s...........
pause(0.02) %pause for 0.02milliseconds
end
end
I have noticed that for iteration subsystems have either a -1 or inf sample time setting. It would be great if the sample time can be configured for the inner for loop. I have also encountered compiling errors when a custom matlab pause function attached to a data source is written within the for iteration subsystems. Are there any solutions to replicating this logic in simulink?
0 件のコメント
回答 (1 件)
Chidvi Modala
2019 年 8 月 7 日
you can refer to Access Block Data During Simulation which lets you work your MATLAB code into simulation process. In the provided documentation you can see the mechanism involves attaching a Post Outputs callback to specific block, so your function is called at every step that the block produces new outputs.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Subsystems についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!