User`s guide
Advanced Troubleshooting
12-21
However, hardware does not allow infinite precision in setting the spacing
between the timer interrupts. It is this limitation that can cause the divergent
sample times.
For all PCs, the only timer that can generate interrupts is based on a 1.193
MHz clock. For xPC Target, the timer is set to a fixed number of ticks of this
frequency between interrupts. If you request a sample time of 1/10000, or 100,
microseconds, you do not get exactly 100 ticks. Instead, xPC Target calculates
that number as
100 x 10
-6
seconds X 1.193 x 10
6
ticks/seconds = 119.3 ticks
xPC Target rounds this number to the nearest whole number, 119 ticks. The
actual sample time is then
119 ticks/(1.193 X 10
6
ticks/second) = 99.75 X 10
-6
seconds
(99.75 microseconds)
Compared to the requested original sample time of 100 microseconds, this
value is .25% faster.
As an example of how you can use this value to derive the expected deviation
for your hardware, assume the following:
• Output board that generates a 50 Hz sine wave (expected signal)
• Sample time of 1/10000
• Measured signal of 50.145 Hz
The difference between the expected and measured signals is .145, which
deviates from the expected signal value by .29% (.145/50). Compared to the
previously calculated value of .25%, there is a difference of .04% from the
expected value.
If you want to further refine the measured deviation for your hardware,
assume the following:
• Output board that generates a 50 Hz sine wave (expected signal)
• Sample time of 1/10200
• Measured signal of 50.002 Hz
1/10200 seconds X 1.193 x 10
6
ticks/seconds = 116.96 ticks