From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

index 2d array

Hi, I'm new to LabVIEW and I'm a bit stuck. I have a matrix that represents the grid of a table. Each part of the grid represents a section of the table that I would like to turn a valve on and off for. I have created a 2D array with the inputs for the valves. I have LabVIEW set up so that I have the array. However, I don't know how to assign the different positions in the array to the different valves (I already have the valves imported). I have looked at the index tool, but I don't understand how to use it for 2D arrays, nor do I understand how to create multiple outputs from the single index block. There are 128 ports, so if there is a way to automate the process, that would be preferable.

0 Kudos
Message 1 of 3
(2,136 Views)

If you want to index a single elements of a 2D array, you need to wire both indices, else you get and entire row or column.

 

It is hard to give specific advice if you don't show us your code, but typically i might be easiest to use a FOR loop and autoindex over an array of valves and your array of booleans, for example. How are you talking to the valves?

 

Please attach a simplified version of your code. Thanks.

 

0 Kudos
Message 2 of 3
(2,132 Views)

Thanks for the response! I was actually able to figure it out from your answer.

 

Thanks again!

0 Kudos
Message 3 of 3
(2,092 Views)