User`s guide
General xPC Target™ Troubleshooting
• Number of I/O channels
Why Is My Requested xPC Target Sample Time
Different from the Measured Sample Time?
You might notice that the sample time you request does not equal the actual
sample time you measure from your model. This difference depends on your
hardware. Your m odel sample time is as close to your requested time as the
hardware allows.
However, hardware does not allow infinite precision in setting the spacing
between the timer interrupts. This limitation 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 the xPC Target system, the tim er 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, the
xPC Target software calculates that number as
100 x 10
-6
seconds X 1.193 x 10
6
ticks/seconds = 119.3 ticks
The xPC Target software rounds this number to the nearest whole number,
119ticks. Theactualsampletimeisthen
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 0.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 0.29% (0.145/50). Compared to the
15-29