MATLAB: How to calculate the maximum sampling rate that the model can achieve with the Real Time Windows Target

frequencyr12rtwsamplingsimulink

How do I calculate the maximum sampling rate that my model can achieve with the Real Time Windows Target?
The overview statement on the Real-Time Windows Target product webpage states that the Real-Time Windows Target "Achieves sample rates exceeding 10 KHz for most models ", but sampling rates can be different than guaranteed interrupts.

Best Answer

The best way to estimate the maximum sampling period is to do some computations first. If you are still in doubt, you can download a 15-day evaluation trial at our website:
This is what you need to take into account for your calculation:
1) The maximum sampling rate of the board. This is the speed at which the A/D converter is able to collect samples into an on-board buffer without any processing and is determined by the A/D hardware. This is typically 100kHz for one channel but may be 1 MHz for very fast boards.
2) The maximum sampling rate of the RTWin kernel. This is the speed at which the RTWin kernel is able to execute a very simple model (say, sine wave connected to a scope). This depends on the CPU of the machine; a faster CPU usually means higher kernel sampling rate (this rule is not always true because things such as cache and CPU pipeline also have effect). This number varies from 10 kHz to 40 kHz, sometimes even higher but not much above this.
3) The execution time of the model. This is determined by the complexity of the model and may be any number from several microseconds up -- even several seconds is possible.
To get the total maximum sampling rate, you must add all these times together. Do the inverse of this number and you have the maximum sampling period.
The interrupts are exact to the precision of units of microseconds, about 5 us on WinNT/2000, and about 10 us on Win9x/Me.