MATLAB Answers

Understanding the rate transition block in realtime windows target

1 view (last 30 days)
Jan Kappen
Jan Kappen on 3 Jun 2013
Commented: Stephen on 17 Aug 2016
Hey guys,
I have a few questions regarding the 'rate transition block' in simulink.
I understand, that a fast sampled signal is zero held via the rate transition block if the following block is slower. So I can only use the nth sample of the first block.
The other way round is the one - I don't understand how a delay can get information that are not there.. But i need the first variant, fast->slow.
But what does really happen? Is the signal really just hold and the following block is evaluated, or does simulink recognize, that there aren't any new information and does NOT evaluate the block and therefore saving calculation (cpu) time?
This came to my mind, because I use the xpc and the realtime windows target toolbox and I wonder if every block in the model is always evaluated. If this is not the case, would it be possible to spread the calculation of blocks that need heavy calculations over some sampling periods of the faster signal?
For example:
[Data input, T=0.1s]-->[rate Transition Tout = 1s]-->[heavy calculation]-->[scope]
The block 'heavy calculation' is too slow to be calculated in 0.1s but in 1s. Does this work?
Thank you very much! Jan


Sign in to comment.

Accepted Answer

Guy Rouleau
Guy Rouleau on 4 Jun 2013
The "scheduling" chapter of he Simulink Coder documentation will explain you how to control ow the execution of a slow task can be spread over multiple steps of a fast rate:
In that page, you should see that, yes, by default the 0.1s task is spread over the 1s task. Howe this introduce a delay of 1s.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by