NI Home > Community > NI Discussion Forums
Reply
Member
rg.naveen
Posts: 26
0 Kudos

How to xor elements in 2D byte array of 44 column and unlimited rows using for loop..

how to xor elements in 2D byte array of 44 column and unlimited rows using for loop.... Such that the result shud be placed in 45th column... help please

Knight of NI
altenbach
Posts: 26,120
0 Kudos

Re: How to xor elements in 2D byte array of 44 column and unlimited rows using for loop..

Do you mean you want to xor each row and append the result to the end of each row?

 

You can use an autoindexing FOR loop. Inside the loop you would xor all elements and append the result to the existing row using build array, autoindex at the loop boundary to create a new 2D array that has one more column.


LabVIEW Champion . Do more with less code and in less time .

Member
rg.naveen
Posts: 26
0 Kudos

Re: How to xor elements in 2D byte array of 44 column and unlimited rows using for loop..

I want to XOR each column, like I'll be receiving a frame of 44 byte data serially by a unit, so the byte array of 44 columns have to be XORed and the result must be written in 45th column. I did this in another method by indexing dis array 44 times using index array.vi and I got the result but in future the operation exceeds to more than 100 bytes so I need to use for loop for this application please help me with a sample vi. I hav attached a vi in which 9 columns hav to be Xored,so help me in doing dis for rest bytes I'll modify as u hav guided.

Knight of NI
altenbach
Posts: 26,120
0 Kudos

Re: How to xor elements in 2D byte array of 44 column and unlimited rows using for loop..

[ Edited ]

Maybe something as follows?

 

 

 

See if it gives the right result....


LabVIEW Champion . Do more with less code and in less time .