LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading multiple arrays loop

I have a program that reads in a 2d array of data of a text file everytime you click a button.  I need to loop this so it keeps adding to the previous array of data until the program has finished.  I know you need a for loop and shift registers but i am still confused on the implementation of it.
 
For example:  text contains:
AB
AB
AB
AB
 
on the VERY next click  i want it to read and store
ABAB
ABAB
ABAB
ABAB
 
so what comes after the array
 
 
0 Kudos
Message 1 of 8
(2,919 Views)
Initialize the shift register to a null string. Inside the loop, concatinate the string with the shifted string and put back into the array. That's my try at a solution assuming I understand what you are trying to do.
0 Kudos
Message 2 of 8
(2,909 Views)
Where does the 2D part of it fit in? You seem to have just a 1D array of strings.
0 Kudos
Message 3 of 8
(2,905 Views)
Its not exactly a string.  The ab is just an example.  Here is my code:
 
The 4th stage is where the output for the array will show.  Thats where I need to loop
Download All
0 Kudos
Message 4 of 8
(2,898 Views)
I tried that and it still does not save the previous array unless i am putting the for loop in the wrong area.
0 Kudos
Message 5 of 8
(2,890 Views)
You need a shift register as mentioned previously (if I understood your objective). See attached.

You can simplify parts of your code by judicious use of Build Array and Initialize Array. See comments in code. Also, I noticed the data in your text file contains floats, but you're converting the strings to integers. Is this on purpose?
0 Kudos
Message 6 of 8
(2,876 Views)


Pierrekew wrote:
Its not exactly a string.  The ab is just an example.  Here is my code:

I think you have 90% too much code! Can you simply tell us how the output should look like, given the input file?
 
I am pretty sure the entire program could fit on the size of a postcard as flat code without the use of any stacked sequences. Currently, things are incredibly convoluted.
 
(It also does not help if the next button has a boolean text of STOP. Your little wait loop needs a wait statement, else it will consume all CPU available.)
0 Kudos
Message 7 of 8
(2,866 Views)
Yes the conversion from string to integer is on purpose.  So far its working with the exception that its cascading one underneath each other as opposed to side by side
0 Kudos
Message 8 of 8
(2,864 Views)