LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mismatch array elements

Solved!
Go to solution

Hi,
I'm comparing the two input arrays, I'm in need to determine the mismatch elements between two arrays.
I've attached the image for the reference.

0 Kudos
Message 1 of 6
(2,623 Views)

Hi Padmanaban,

 

some pseudocode:

a[] := AppendArrays( input1, input2)
FOREACH element in a[]
  bool1 := element found in input1?
  bool2 := element found in input2?
  IF bool1 NAND bool2 THEN
    append element to output[]
  ENDIF
NEXT

What have you tried so far?

Where are you stuck?

You know we will not do your homework!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,616 Views)

Hi,

I got struck at Array indexing while using with nested for loop.
If 1st input array index was enabled in outer loop, then I can find only the missing element from 1st array and Vice versa.
So I've to find missing elements from both input array inputs.

0 Kudos
Message 3 of 6
(2,605 Views)

Hi Padmanaban,

 

did you understand my pseudocode?

Your VI uses a different approach than my suggestion - maybe that's the problem? 😄

 

Attaching just images of code doesn't help a lot. We cannot debug/test your image with LabVIEW.

Please attach your VI!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,578 Views)

I've attached the snippet.
Can I do this both mismatch elements functionality within single nested forloop?

 

0 Kudos
Message 5 of 6
(2,574 Views)
Solution
Accepted by topic author PadmanabanJ

Hi Padmananbad,

 

sure you can do it with just one loop!

As I described by the pseudocode above:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(2,566 Views)