LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Doesn't Reinitialize

In my experiment system I want to generate an array of 4 columns by a variable number of rows that will be written out to a DAQ unit and drive the experiment.  My current efforts creates the array I want for the first pass but additional calls append to the initial array rather than reinitialize and start over.

 

The attached vi has a lot of complexity for things I plan to do after I get past this block.  The point of interest is the FOR/NEXT loop in the "Start" state.

 

How do I get the array reset?

 

Thanks for your help.

 

Bill Monette

Indiana University, School of Optometry

Download All
0 Kudos
Message 1 of 6
(2,568 Views)

If you had a "Stop" case (or an OFF button or something), you could reinitialize to default value (right click > Create > Invoke Node > Reinitialize to Default). If it doesn't reset correctly, make sure that the empty array is set as the default. (With an empty array, right click > Data Operations > Make Current Value Default)

0 Kudos
Message 2 of 6
(2,558 Views)

The intialization of the feedback node only occurs the first time the Start case executes.  (Check the help on the feeback node for the intializer.)

 

If you want to reset it some other time, then you need to wire the initial array into the feedback node instead of the current array.  But since your Array is only ever modified within the Start case, I wonder what it is you are trying to do with that data.

0 Kudos
Message 3 of 6
(2,551 Views)

This matches what I have found.  My plan is to pass the array to the output state (or possibly bring the output code into the start state) where it will be clocked out to the DAQ unit in increasing, decresing, or random order.

0 Kudos
Message 4 of 6
(2,541 Views)

Then you should bring the feedback node and indicator out of the start state so that other states can access that data also.

0 Kudos
Message 5 of 6
(2,534 Views)

Thanks to both of you for your responses.  I am past my current block thanks to your help and I have learned a lot about the initializer input.  For me at least the key was "Move Initializer One Loop Out".

 

Again thanks.

0 Kudos
Message 6 of 6
(2,521 Views)