01-09-2014 02:50 PM
Lets say I have an array like this.
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
Now I want to change this array and copy each row n time. Let's say for now n=1 so the array should become like this.
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
and if n=2 then the below table
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | |
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | |
1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
|
so i should add the new copied rows and shift the table down. And as can be seen the one before last bit should always follow this pattern 1,01,011 then 0111
Could you please help me to implement it in LabVIEW
Thanks
01-09-2014 03:06 PM
01-09-2014 03:26 PM
Thank Gred
the probelm is if I change the bit in the inner loop then it will change for all n copies. While I would like to follow this pattern : 1 01 0111 01111
01-09-2014 03:52 PM
@tintin_99 wrote:
Thank Gred
the probelm is if I change the bit in the inner loop then it will change for all n copies. While I would like to follow this pattern : 1 01 0111 01111
This is only true when applying the same bit modification in each iteration. You can setup an array of values that contains the modifications that need to be done in each iteration and index this in the inner For Loop. If I correctly understood your demand, an OR operation should be the one that needs to be added to the inner loop.