LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build array

Solved!
Go to solution

Included is an example of what I want to do with my vi. 

 

The way I want it to work is:  If a test is selected, the select gate then sends this array to the build array, and the array that comes out is correct.  If no tests are selected, the appended array will be 0,0,3,3.  If only test 1 is selected, the appended array should be 0,0,1,1,3,3.

What doesn't work:  If no test is selected, my appended array is 0,0,0,2,5,0,2,1,4,0,2,5,0,2,1,3,0,2,5,0,...

 

I probably am not understanding the way build array works, or am overlooking something. 

 

The final application is a state machine, with each state performing a different function.  It works well, but once I introduced the options for certain tests to enable or disable, the appended array came out wrong.

 

Thanks for the help.

 

 




metzler CLAD
0 Kudos
Message 1 of 6
(3,428 Views)
Solution
Accepted by topic author metzler

Your constant array labeled 'start Test' has 35 elements and they all end up in your appended array.  Actually all your constant array have extra values.  If you clean them up and empty the array attached to the false case it works fine.

 

 

0 Kudos
Message 2 of 6
(3,414 Views)

What do your 00 11 22 33 represent?

 

If you only have a choice of two arrays, then why not simply have the full array populated and select the one you want.

If you want to append to the array based on one or multiple selections, then you may want a different implementation to the one that was provided.

 

Please describe what you are trying to achieve.

 

R

0 Kudos
Message 3 of 6
(3,408 Views)

 

Thanks Jack47.  One question, what is the easiest way to clean up the array and get rid of the extra elements?

 

Thanks.




metzler CLAD
0 Kudos
Message 4 of 6
(3,386 Views)

Good Morning metzler,

 

When dealing with large arrays, I will write code to programmatically modify the array (using VIs on the Arrays palette).  With small arrays like you have, I will generally change them manually.  Try this:  1) Expand the array so that you can see all of the elements.  2) Write click on the first element you want to remove.  3) Select Data Operations>>Delete Element.  4) Repeat as needed.  5. Shrink the number of visible elements to your liking.

 

Even in a small array, if you need to remove more than half, I would create a new array and add the required elements.

0 Kudos
Message 5 of 6
(3,365 Views)
With small array, it's probably eaiest to select the array, right click select advanced->empty array.  Then put your two values you want in.
0 Kudos
Message 6 of 6
(3,361 Views)