06-16-2011 07:40 PM
First. Get rid of that huge slider. The style guides recommend that panels and block diagrams should be no larger than one screen.
Use a shift register. Initialize it with the starting frequency. In each iteration of the loop write to the DCA, then read the analog input. Test for your triangle condition. If it is not met, increase the frequency and go to the next iteration. When the condition is met, calculate the slew rate and stop the loop. Consider some means of stopping if the condition is never met, such as a maximum frequency.
Move the initialization of the DAQ outside the loop. No need to re-initialize on every iteration. You should also end the DAQ tasks after you exit the loop.
Lynn
06-17-2011 01:55 PM
@johnsold wrote:
NIquist,
He is not sampling at that rate. He is feeding a square wave of that frequency to the input of the op amp and expecting to see a triangle wave (slew rate limited) at the output.
Lynn
Ah, of course, I've done similar testing in the past. Guess I'm getting spoiled by the abundance of cheap, high-speed hardware available these days.