jumpinkiwi,
I believe the jitter you are seeing is actually caused by the fact that the Timed-Sequence is taking more than 2 ms to configure/run/clean-up, therefore your I/O loop is late (you should be getting some timeouts in your code) and subsequent iterations are triggered immediately, causing the large variation at the output. The actual SW jitter of the Timed-Sequence on that controller is actually not that much, below 150 us, but that's besides the point, since it is taking so long that you can't even have it in your I/O loop.
It's important not to confuse jitter with determinism. Determinism means that the feature executes within a bounded amount of time. In the case of the Timed-Sequence, determinism is guaranteed for anything inside its frames, but set-up and tear-down of the structure is not guaranteed to be, nor is, deterministic. The trace tool shows plenty of memory allocations going on at the set-up and clean-up stages of the structure.
I attach the benchmark code as well as a screenshot of the 9002 benchmark
I also ran the same test on two other targets:
Controller |
Average Timed-Sequence (us)
|
| Jitter (us) |
cRIO-9002 |
2100 |
| 145 |
cRIO-9014 |
1400 |
| 64 |
PXI-8106 /
Single-Core Mode |
43 |
| 4 |
I think that a Timed-Sequence is overkill and also incorrect for what you are trying to accomplish. It is overkill because it provides quite a lot more functionality than you are currently using (timestamps, feedback, dead-lines, multiple frames). It is also incorrect because you are using it inside your critical loop, and its setup and tear-down are not deterministic, therefore execution time is unbound. The better solution would be, as you suggest, using a simple microsecond wait and standard sequence structure.
On a related note, I noticed that IRQ_Update (Controller).vi was set to run at normal priority. Assuming that it doesn't have any callers with higher priority, you might want to increase the priority of this VI so that other system threads don't interfere with this task.
I hope this helps,
Alejandro
Message Edited by aasenjo on
11-06-2007 06:15 PM