LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I connect 2D array Boolean to the input of case structure?

Solved!
Go to solution

Hi

 

I would like to know how to solve this problem. I try to connect the output of a Numeric 2D array and a constant number to 'GREATER' before connecting it to the input of the case structure. An error message appears and it shows '  The type of the source is 2D array of boolean . The type of the sink is boolean'.

I've tried to 'disable indexing' on the box of the case structure but the error still exist. Would appreciate any feedback on this. 

0 Kudos
Message 1 of 5
(5,010 Views)

hi cocobanana,

  Actually if you are comparing a 2-d array with a constant,the output will be 2-d array of booleans...for that i can suggest you place another for loop outside the present for loop,so the value inside the for loop will be a constant,,,,so you can compare easily a value with a value outputting a boolean value and wire that to the case structure....

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Message 2 of 5
(5,001 Views)
What comparison are you trying to do? Do you want to check if all the elements in the array are greater than the constant? If so, right click the Greater function and select Comparison Mode >> Compare Aggregates. Then the output will be a scalar Boolean indicating whether all the elements in the array are greater than the constant.
Jarrod S.
National Instruments
Message 3 of 5
(4,993 Views)

Hi. Thanks for the speedy reply. Ok. I've tried and found out that since im comparing the value to 0, I can just use 'less than 0' to do my comparison. However, (refer to my attached doc)  I found out that my output array (Unmet Load) does not show any value.

 

I did a test on that small part on a new VI and found out that if my data type is not in 1D array or 2D array form, it will show my desired output in the output array.

 

Since my actual VI contains data from 'Read from Spreadsheet' and it is in 2D array form, I have to insert index array before connecting it to my case structure. As you can see from the doc, only the first value of  the Excess Energy/ Unmet Load is read into the Array. And when it goes to the case stucture and shift register, no value is read in my (Unmet Load) array.

 

Please advice. Thanks!!

0 Kudos
Message 4 of 5
(4,972 Views)
Solution
Accepted by topic author Coco Banana
Input 0 to third input of index array, not the second one.
Message 5 of 5
(4,956 Views)