Hi
I have a vi which has four parallel running while loops. One is used
to acquire data from the data acquisition board, one is used to plot
the data, one is used to calculate a setpoint which is then used in
the fourth loop which contains the PID.vi from the PID Toolkit.
I want my loops (particularly the PID loop) to always run at a rate of
one iteration per 0.3 seconds, so I have placed a "wait until next ms
multiple" function in each of the loops and wired a value of 300 to
them. I am using the "Time since last call".vi to determine the speed
of each loop.
The problem I am having is that sometimes the loops run with a time of
precisely 0.3secs (which is good), yet other times the loops (from the
very moment of pressing "run") oscillate around 0
.3 seconds (sometimes
upto +/- 10%). There seems to be no rhyme or reason (that I can
detect) that makes it sometimes work and sometimes not. If it happens
to be an occasion where the time oscillates, then it will continue to
oscillate for the duration of the run. vice versa, if it happens to be
an occasion when it works fine, then it will work fine until I press
end.
I can literally run my program, have it work OK, press stop, press
start again, and it not work OK.
Can you think of any reason as to why this maybe?
I have local variables in some loops, which are calculated in others.
Could this be a problem?
Thanks for your time,
Dr Jonathan Atkinson