LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display only "true" values in a table

Solved!
Go to solution

Hi, the support in this forum is really great, so I hope you can help me with this one:

 

I'm doing a Min/Max comparison with data I measured before and arranged for an XY graph.

 

Actually I'm comparing two 1D-Arrays and getting a 1D-Array of boolean as result.

This is ok, but I only want to show the index of the true values.

 

Anyway, I just want to show the x-values, where the threshold was broken.

 

Any ideas are welcome!

0 Kudos
Message 1 of 10
(2,994 Views)

Hallo Steffen,

 

you need to create that pseudo-code:

FOR all bits in boolean array
  IF bit(i) THEN add i to output array
NEXT

You need a FOR loop, a shift register, a case structure and a BuildArray node.

In recent LabVIEW versions you only need a FOR loop and select the correct output tunnel mode…

Best regards,
GerdW


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

Hey Gerd, thank you for your answer!

 

I'm not really sure how to program this in labview, but I tried to get in the right direction.

 

Maybe this is not the right way to get what I want.

Do you know another way to get all the x-values (not the index value), when comparing the y-array with the max-array?

0 Kudos
Message 3 of 10
(2,973 Views)
Solution
Accepted by topic author SteffenS

Hi Steffen,

 

not at all:

check.png

No need for ArraySize, (RubeGoldberg) boolean comparisons, and placing the build array in the wrong place…

 

I guess I already mentioned to take all those beginner courses offered by NI.com? This is pretty basic LabVIEW stuff!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(2,969 Views)

I know the syntax, but I have problems to handle these arrays.

 

Thanks to your help, I could get the actual x-values out of the array!

 

 

0 Kudos
Message 5 of 10
(2,957 Views)

Hi Steffen,

 

now you created an even bigger Rube-Goldberg: All that code belongs into one loop!

 

No need to create an index array first when you can index your Y values directly!

check.png

Best regards,
GerdW


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

you are right, again! Smiley Happy

 

 

0 Kudos
Message 7 of 10
(2,937 Views)

I believe you have LV2013. Here is simplified code of GerdW's by using the Conditional Enable terminal option.

ConditionalIndex.png

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 10
(2,912 Views)

Smiley Very Happy

Anand, You forgot somthing here.

May be you were in hurry

0 Kudos
Message 9 of 10
(2,900 Views)

Yes 🙂 I should have named it as "Y" and made it a control.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 10 of 10
(2,887 Views)