Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

09-21-2019 09:36 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello everyone!

I'm sorry if this is a simple question. I'm actually new to LabVIEW.

I wonder what is the best way to solve this problem in my code:

I have 3 1D array each contains simple numbers.

I have written a case structure which I intend to be executed only if there a predefined max values in all 3 arrays.

in simple word:

if max in array1 > A && max in array2 > B && max in array3 > C >> execute case structure.

How should I do it?

Thanks.

Fernando.

Solved! Go to Solution.

09-21-2019 10:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@Fernando68 wrote:

Hello everyone!

I'm sorry if this is a simple question. I'm actually new to LabVIEW.

I wonder what is the best way to solve this problem in my code:

I have 3 1D array each contains simple numbers.

I have written a case structure which I intend to be executed only if there a predefined max values in all 3 arrays.

in simple word:

if max in array1 > A && max in array2 > B && max in array3 > C >> execute case structure.

How should I do it?

Thanks.

Fernando.

Well, you seem to have driven the condition all the way down to TWO CASES.. .... Select is an option. Wiring that boolean output to a Case Structure's selection node is another option.

Jay Thornby

Averna Automated Test Systems

Solution

Accepted by topic author Fernando68

09-21-2019 10:19 AM - edited 09-21-2019 10:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Maybe something like that?

(built array, FOR loop, array max, greater?, AND array elements, case structure)

The above assumes that the three arrays are of equal size. If the sizes can be different, a little bit more code is needed, especially if the max is <0.

09-21-2019 12:04 PM - edited 09-21-2019 12:07 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you!

I don't know if I should make another thread for this question or not.

Let's say each array contains one column with 500 rows of numbers and the max value is non-zero.

And let's suppose that the max value of the Array1 is in index number 300 (300,1).

How can I execute the case structure only if the Array2, and Array3 max values are in a predefined indexes before of after the index value of the Array1 (For example from index number 250 to 350)?

I want to define a window where if the second and third arrays have a predefined max values above an specific number in that window compared the first array ( which can be any of the 3 arrays ) then the case structure should be executed.

Thanks again.

Fernando.

09-22-2019 04:23 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Thank you!

I think I need to make another thread for this question but let me ask it anyway.

What if I go one step further.

Let's suppose that each array contains one column with 500 rows of simple numbers and they have same sizes.

And let's suppose that the max value of each array is non-zero but different from another one.

Let's suppose that the max value of (for example) Array2 is above B and is in the index number 300 (300,1) , How can I set the case structure to be executed only if the max value of Array1>A and max Array3>C "AND" index numbers of max of Array1 and max of Array3 are from 250-350 ?

I what to define a windows where the case structure should be executed only if the max value of all three arrays are above predefined value "and" inside that window compared the the index number of one particular array.

Thanks.

Fernando

09-22-2019 10:11 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

When you get the index of the max, put it through the in range and coerce function to see if it is IN RANGE of your desired values. Now you have a boolean.

Use that with the boolean logic you are already using.