LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input array listing possible test results to generate all test scenarios

Solved!
Go to solution

Ok, I've been fighting this for a few hours now, and can't wrap my head around how to do it.  Basically, I want to take 1 array that has "test names" in columns and each row lists all possible values for that test.  I want to turn that array into another array listing every single combination of those test results (so i can feed it into my program to do some handling testing... but that is aside from this).  The original array has (currently) 27 columns - which could expand; and each test has anywhere from 2 to 5 possible results.  

basically, I'm trying to turn the first table in this screenshot into the second one.   I'm sorry if this is already posted somewhere, but all I could find was info on truth tables and other table manipulation that wasn't quite so expansive - which is where I'm getting stuck.  Thank you in advance.  I know this is probably way simpler than I'm making it, lol

Annotation 2020-07-01 105811.png

0 Kudos
Message 1 of 22
(3,524 Views)

Nested For Loops.

0 Kudos
Message 2 of 22
(3,521 Views)

yeah... I know that's the path I need to go down... I just can't quite get it to do what i want... 

0 Kudos
Message 3 of 22
(3,498 Views)

I'm attaching what I have so far.... I just can't quite get it...

 

0 Kudos
Message 4 of 22
(3,482 Views)

Like this.

 

No unnecessary array manipulation.

0 Kudos
Message 5 of 22
(3,473 Views)

Is there a way to do this without having a for loop for each column?  My data currently has 27 columns....  but the next time, it might be 10, or 50?  is there a way to do it without having to manipulate the .vi for each scenario? (that's where I'm getting stuck)

0 Kudos
Message 6 of 22
(3,468 Views)

Sure.  But now you are expanding the problem.  And it will be exponential.

 

Let me think about it.

 

Think about it as a numerical problem.  Suppose it was a 27 digit number?

0 Kudos
Message 7 of 22
(3,463 Views)

Could you save for '17 version or post screenshots of what you have?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 8 of 22
(3,461 Views)
0 Kudos
Message 9 of 22
(3,458 Views)

yes, I know.... it is a mess!  This problem comes up for me quite often... I usually use excel to copy and paste everything in there, but with 27 different attributes each with 3-5 different possible values.... i just thought there would be an easier way to do it programmatically... but i think I've spent more time on this than I would have if I had just copied/pasted the data, lol.  It's just it comes up so often, and it is never the same number of attributes/possibilities....

0 Kudos
Message 10 of 22
(3,449 Views)