LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to create a vi with a customizable number of same input type?


@thoraz wrote:

In every input cluster I have a density spectrum, two number which define a band and a number which defines a threshold. In output I want a boolean signal which tell me if the threshold for every spectrum in his defined band is passed.


That seems trivial to implement using a single 1D array (variable size) of such input clusters as input and a 1D array of booleans as output (it will automatically have a matching size). Can you show us some code with typical data?

0 Kudos
Message 11 of 15
(454 Views)

The output isn't a 1D boolean array, but only ONE boolean signal which indicates that every threshold has passed at the same time.

0 Kudos
Message 12 of 15
(449 Views)

Then perform an AND operation on the above described array, and output the result of that. Your input to the vi should be an array of your clusters. 

0 Kudos
Message 13 of 15
(447 Views)

@thoraz wrote:

The output isn't a 1D boolean array, but only ONE boolean signal which indicates that every threshold has passed at the same time.


Yes, do an "AND array elements" to get that. (Either before or after the subVI boundary). I would prefer after, so you have the option to troubleshoot which ones failed by having the entire array available for inspection.

0 Kudos
Message 14 of 15
(441 Views)

@thoraz wrote:

Maybe this could be the quik solution. Can I do it with clusters as input?


I think you're not aware that arrays in LV are variable size.  Clusters will have defined elements.

 

The only way to do what you want with a cluster is to either include the array in your cluster or to have an array of clusters.

 

After that, why would it matter if you want a boolean for each element or all elements together?  The logic wouldn't really change.  You'd AND all of the original elements or you'd use AND Array Elements to do it all at once.  That caveat didn't complicate anything.

0 Kudos
Message 15 of 15
(429 Views)