LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unbuilding 2 dimensional arrays

Hi,

 

I need a little help.  I have created a VI to set three controls which set up a device.  On another VI (My test sequencer), I am using a  2-D Matrix of test numbers, and the 3 parameters for the switches.

 

Using a Loop routine I can retrieve these 3 parameters for each test sequence, but for my VI to work I require all three parameters at the same time.  Using the loop function gives me each element, but I am not sure how to pass all three elements.

 

Anyone have any ideas.  TIA

 

I have attached a screen shot.

 

Martin

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

That code does not make any sense. You've also made it unreadable by all of that goofy wiring you've got at the top. If you need the data from a single row, just index out the row. You can then index out individual elements in the row all at once.

 

Message Edited by Dennis Knutson on 09-03-2008 09:19 AM
0 Kudos
Message 2 of 3
(2,577 Views)

Step 1: Learn not to use local variable unless you absolutely have to, and even then think about it at least 10 times. Local variables are usually a crutch for folks who are used to text-based programming.

 

Step 2: Learn to auto-index loops. You do not need to get the array size and calculate the number of times to run the loop based on that. Simply wire the array directly through the loop. It will auto-index:

 

In terms of your question it seems to me that you want the subVI inside the loop. It also seems that you only want one loop, not 2. If you auto-index the loop you'll get each row. Then you can use Index Array to get the individual column elements.

 

Also, is there a specific reason you're using a matrix as opposed to a standard 2D array

Download All
0 Kudos
Message 3 of 3
(2,572 Views)