LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need to add the subarray sequentially.

I need some URGENT help. I am collecting data from 4 channels simultaneously ( or nearly simulataneously ).I need to extract the 4 sets of data for EACH iteration and attach to the previous set of data i.e

if my FIRST ITIRATION DATA FOR THE 4 CHANNELS IS

CHANNEL 1 DATA : 0.1 0.2 0.3 0.4... 0.5
CHANNEL 2 DATA : 1 2 3 4... 5
CHANNEL 3 DATA : 11 22 33 44... 55
cHANNEL 4 DATA : 111 222 333 444... 555

and my second iternation data is

CHANNEL 1 DATA : 0.5 0.6 0.7 0.8... 0.9
CHANNEL 2 DATA : 5 6 7 8... 9
CHANNEL 3 DATA : 55 66 77 88... 99
cHANNEL 4 DATA : 555 666 777 888... 999


Then I want to ad
d the results of the first iteration to that of the second iteration to corresponding channels

1) 0.1 0.2 0.3 0.4.. 0.5 0.5 0.6 0.7 0.8... 0.9
2) 1 2 3 4..... 5 5 6 7 8... 9
3) 11 22 33 44... 55 55 66 77 88... 99
4)111 222 333 444..555 555 666 777 888... 999

In this fashion I want to add the data for a total of 50 iternations.
I have attached my code. IN this code i collect the data in a while loop for all 4 channels. I have extracted the vaules for the 4 iterations . However I want to write code so that I dont have to extract each and every iteration set.

thanks
0 Kudos
Message 1 of 8
(3,530 Views)
First you should transpose the two arrays. Then build out of both a new array with the "build array"-function. Here you must select the inputs to be attached (via context menue). Then transpose the output again. You will get the desired 2-dimensional array.
That's it.

Lorand
0 Kudos
Message 2 of 8
(3,530 Views)
I have attached the three dimensional array....
0 Kudos
Message 3 of 8
(3,530 Views)
I dont have just 2 arrays. I have one 3 D array of dimension 21 X 4 X 100

meaning there are 21 iterations and each data contains 100 points of data for each channel .

I want to extract the ist iteration
for (1) 4 X 100
for (2) 4 X 100 and so on...

till
for (21) 4X100 and add all of them....
0 Kudos
Message 4 of 8
(3,530 Views)
Hi,

I have attached a simple VI that generates a a set of random numbers and appends the data together and puts it into a 2D array.

If you already have a 2D array to start with, then you will have to split it and then append data to the 1D array as shown in the attached VI. You can then combine the 1D arrays

Feroz
0 Kudos
Message 5 of 8
(3,530 Views)
Is your problem solved yet?
0 Kudos
Message 6 of 8
(3,530 Views)
Yes thank you, but I solved it myself. I used a forloop and shift registers to update the array.
thank you very much for your help!
0 Kudos
Message 7 of 8
(3,530 Views)
Hi,
even if you've found a solution, here is another one I tried out on Friday.

Lorand
0 Kudos
Message 8 of 8
(3,530 Views)