11-24-2009 04:40 AM
Hi everyone, let's say I want to wire a 2*2 boolean array to a case structure, and execute events according to the (I don't know the exact term) but I'll go with coordinates of the elements in the array... e.g. if (0,0) is true do this, else...
So when I directly wire the array to the case structure, a broken wire appears indicating two different data types (array/element).
Any suggestions?
Thanks
11-24-2009 04:54 AM
You are going to use a case structure whose case is being selected by a boolean array. So each element in the array is going to have either a true value or a false value. So for all the elements you will have just two cases, either true or false (in the case structure)!!! You can do this by simply wiring a boolean control instead of a whole array
11-24-2009 05:09 AM
you cannot wire the array directly to the case structure. For wiring an array to the case structure, you need to extract the individual elements from the array.
See attached vi for clarification.
11-24-2009 05:10 AM
Okay I knew I didnt make any sense, here's a rephrase, lets say this is the arraY
B1 B2
B3 B4
where B1, B2, B3 and B4 are all of Boolean nature, lets if B1 (0,0) is true and others are false, I want to do this or that... This is probably what I wanted to say earlier.
11-24-2009 05:13 AM
For a 1D array, you can use the boolean array to number primitive and then wire this number to the case structure. So true, false would be case 3...
Felix
11-24-2009 05:15 AM
11-24-2009 05:19 AM
Well Felix what if it's a 2*2 array? Plus I didnt get what you mean by "to number primitive"
Thanks
11-24-2009 05:22 AM
The two I32 values are the dimensions of the array. since it is a 2X2 array, so both the I32 values are 2 and 2 (means 2 rows and 2 columns)
11-24-2009 05:24 AM - edited 11-24-2009 05:26 AM
ROFL :D:D it was my bad, I kinda read it through, anyway, why did we go through the array to cluster? And why did you add to for loops?
11-24-2009 05:27 AM
why did we go through the array to cluster?
Because i wanted to extract the elements which were stored in the array. These elements will tell me the size of the main array.