LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

newbie question: max speed of while loops

I caved and bought a PCI 6602 counter card to make my life easier when I want a quick fix but I would still like to get the fast loop to work.

 

I changed the loop contents to be very simple as suggested here:

 

while(true){

 data_out=[ (i AND 2) =? 0 ]

}

 

but it is still very slow.  I think i can get around 5khz but with significant jitter.  I don't have a scope handy but hopefully will get the usb one I ordered off ebay soon to analyze the signal.

 

Right now, I'm outputting to my linear table and watching the speed of the motor spin and compare it with a PWM output on the counter at the same rate.  Can't seem to get similar performance above 5khz.

 

What other optimizations can I do?

0 Kudos
Message 21 of 22
(1,015 Views)
Is data out just toggling between true and false?  If so, why not use a shift register of boolean data type and use the Not! function on it?  I would think it would take less time than a boolean AND and a comparison.
0 Kudos
Message 22 of 22
(992 Views)