10-08-2009 04:08 PM
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.
Solved! Go to Solution.
10-08-2009 05:15 PM
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.
10-08-2009 05:36 PM
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
10-08-2009 10:55 PM
Thanks Jack47. One question, what is the easiest way to clean up the array and get rid of the extra elements?
Thanks.
10-09-2009 08:49 AM
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.
10-09-2009 08:58 AM