LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete array element

Hi, I'm new to labview. I'm doing an array comparison with input. And I have managed to do it.

 

Now I want to remove the output of the array that doesn't match with the comparison and you can see that the matching output is all equal to the value of that comparison. The output value should be equal to the input value instead of the comparison value.

 

I attach my vi

 

SofeaNur_0-1671716992985.png

 

0 Kudos
Message 1 of 3
(935 Views)
  • Do you know what happens when you "And" two integers?  [Hint -- it does not tell you if the integers are equal].
  • Why are you mixing Binary and Decimal representations in your test code?  If you were using U8s instead of U32s, you might say "I want to see what is happening at the Bit level", but in that case, keeping track of 8 bits is much simpler than dealing with 32 of them.
  • If you have an N element array and you want to "flag" certain elements, do you think removing them (so you have, say, N-7 elements in the output array, all in binary, mind you, will make it "easy" to see what you did?  Can you think of a better way to "flag" the "differing elements"?  How about creating a "Differing" Array of Booleans that is True if the input array number differs from the Compare?  What if, after you saw the Differing Array, you wanted to convert it to a "Same" Array?

Keep writing simple VIs to test your understanding of how LabVIEW works and how to make it "do what I want, not necessarily what I told you to do" -- this is often the best way to get your "Aha!" Moment.

 

Bob Schor

0 Kudos
Message 2 of 3
(904 Views)

@SofeaNur wrote:

Now I want to remove the output of the array that doesn't match with the comparison and you can see that the matching output is all equal to the value of that comparison. The output value should be equal to the input value instead of the comparison value.


Your Question and your attached VI make no sense at all. Your VI is not even runnable. Once you fix your code (e.g. by removing the shift register and FOR loop) and run it, you will see that the output is the input masked (AND'ed) with the "compare" input.

 

Why is your subject line about "delete array element"? What exactly are you trying to delete? Bits are NOT array elements. And you cannot delete them, you can just set them to zero.

 

Study this:

 

altenbach_0-1671726726679.png

 

 

0 Kudos
Message 3 of 3
(889 Views)