05-09-2012 11:45 AM
Hello all,
I created a VI called "Get Data" (see below) that takes multiple string arrays and organizes the information into a 2D Array ("Window List"), a single row with 85 columns. (Side note: Each row represents data about a window)
I wired i+1 to my VI, so iteration 0 writes Window 1, iteration 1 writes window 2, etc etc.
I wired the total # of windows/rows to write to "N", so the loop would stop after the last window has been written to the array.
Here is an example of one row of data (yes, the gaps are necessary, unfortunately)
The problem I'm having is that it doesn't retain each row of data between iterations. Once the loop completes, I am left with only the last row of data that my VI wrote. How do I have the VI fill all rows instead of only the last one?
05-09-2012 11:58 AM - edited 05-09-2012 12:00 PM
This is kind of basic LabVIEW...you might want to look into a class or tutorial.
There are a few ways to do what you want to do. The simplest one is to use a shift register and a "build array" function. The input shift register and the output from your subVI will be wired to the "build array" function inputs. The output of the "build array" function will be wired to the output shift register.
If you have your data come out of your subVI as a 1D array (1 row containing 85 elements), then you can right-click on the FOR loop border and select "enable indexing". The result will be a 2D array, each row containing the data set from a single loop iteration.
Hope this helps a little.
05-09-2012 04:35 PM
You should probably bundle all related wires so you can use less connectors. (Unbundle them inside the "Get Data" sub-VI.)