LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I stop the for loop iteration counter from continually looping in a while loop?

Hi all,

 

I have a VI which uses an event structure within a while loop.  One of my events aquires an array of data using a for loop.  When I run the event the first time the code responds as i would expect, the for loop runs 10 times and then outputs the expected values.  But if I try to run it again, after it has completed the first time, the for-loop seems to have reset its counting and when I click "Calibrate Zeroes" it starts the for-loop at whichever iteration it is currently on.  Can anybody help me?

 

Thanks

0 Kudos
Message 1 of 4
(2,498 Views)

If you want to maintain a counter over several calls of a loop, use a shift regsiter in the FOR loop as whell as the outermost while loop. Initialize on the outside ith zero an increment inside the FOR loop. (I have not looked at your code).

0 Kudos
Message 2 of 4
(2,484 Views)

Shouldn't you tell the FPGA when to start sending the data?  Otherwise you are probably just getting really old data that is just filling up your DMA FIFOs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(2,477 Views)

OK, looking at your toplevel VI, that's just a general mess:

 

  • Use a plain 2D array. Don't use matrix datatype.
  • Use plain array operations, no need for all these werid array constants.
0 Kudos
Message 4 of 4
(2,472 Views)