Set the sample rate for the target application

The code runs at a timing interval established by an interrupt generated by an onboard clock. Therefore, the generated code runs at a hardware-generated clock rate. This base clock rate is set under System > System Properties > Range. It is important to set this rate correctly since it is used to calculate digital filter coefficients and other controller parameters. You can also change this rate in the Target Interface block dialog.

If the generated code cannot keep up with the specified sample rate, you will see the following message:

Target sampling too fast

Additionally, any background idle loop tasks will be starved of CPU time and will not run.

For example, suppose you request a 10 kHz sampling rate (with timer interrupts generated at 100 ms), but the diagram takes 150 ms to run. This means that by the time the calculation from the diagram has finished, there is already another pending interrupt and you are no longer maintaining the 10 kHz rate.