LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Index array

Hello I have a program that uses an index array vi to output a subarray from the two dimension array


Attached is the VI.

 

Iam creating another 2 dimensional array and trying to use the same index array to output a subarray more like a a row of a  matrix...

however when I click on the index array and wire the 1 dimensinal boolean array and it gives an error and says that I can wire 2 different data type..

 

the 2 dimensional array I have is in boolean and iam using an indexer to output one row of this boolean matrix-just trying to repeat the same process. but as I click on the index array icon, i just cant figure out how to change the output of the indexer to a 1 dimensional boolean array..

0 Kudos
Message 1 of 5
(2,938 Views)

@SK0480 wrote:

the 2 dimensional array I have is in boolean and iam using an indexer to output one row of this boolean matrix-just trying to repeat the same process. but as I click on the index array icon, i just cant figure out how to change the output of the indexer to a 1 dimensional boolean array..


Please explain. Your index array outputs a 1D array. Isn't that what you want? Please attach the broken VI.

 


SK0480 wrote:

however when I click on the index array and wire the 1 dimensinal boolean array and it gives an error and says that I can wire 2 different data type..


Please quote the entire error message verbatim.

0 Kudos
Message 2 of 5
(2,933 Views)

The output will only be a 1D arra if you leave one of the indices disconnected. If you wire both indices, you get a single boolean, not an array.

 

Your entire codee is ridiculously complicated, for example how you do the incrementing/decrementing and how you use a greedy inner loop to start/stop the output. Why is the outer loop a FOR loop? Here's a quick attempt at some simplification of the logic. modify as needed.

0 Kudos
Message 3 of 5
(2,930 Views)
Well iam using for loop to control steps of the stepper motor because the number of steps are user specified. With while loop, it will keep going forever. As far as the index array goes the problem iam having is that when copy and paste the indexer in the block diagram and attach another 2d boolean array the output changes to boolean value instead of a boolean array and then when I connect a boolean led to check the output it gives me an error that iam connecting two different datatype
0 Kudos
Message 4 of 5
(2,917 Views)

We could solve it in five seconds if you would attach the broken code. Much more efficient than ambiguous words? 😄

 

Are you sure the 2D array is not turning into a 1D array due to autoindexing at the loop boundary, for example? Are you sure you have not wired both indices?

0 Kudos
Message 5 of 5
(2,912 Views)