MATLAB Answers

0

Understanding the rate transition block in realtime windows target

Asked by Jan Kappen on 3 Jun 2013
Latest activity Commented on by 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

  0 Comments

Sign in to comment.

1 Answer

Answer by Guy Rouleau
on 4 Jun 2013
 Accepted Answer

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.

  1 Comment

The above link didn't work for me, alternative link below: http://uk.mathworks.com/help/rtw/scheduling.html

Sign in to comment.