LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D-Array as input vi

Hi,

How can I have a 2D-Array as an input of my vi?

I want from one vi pass a 2D-Array as a parameter to another vi. How can I do it?
I define an input in my vi as a 2D-Array but LabVIEW tell me that this input (2D-Array)has a undefined type.


Thanks
0 Kudos
Message 1 of 13
(3,152 Views)
Your 2D array cannot have an undefined type. You must define it as a 2D array of DBL, SGL, string, boolean, etc. If you need to ability to pass it several types, you can create a polymorphic VI.
Message 2 of 13
(3,148 Views)
ok, thanks,

and... how can I know the position of a item in my combobox, in other words, the index of a item in the combobox?

Thanks,

ToNi.
0 Kudos
Message 3 of 13
(3,133 Views)
You can use the property Strings[] wired to the 1D Array input of Search 1D Array and wire the combo box control to the element input. The output will be the index of the selected item.
Message 4 of 13
(3,129 Views)
Hi,

Now I put in my combobox a string and value with the property StringsAndValues[], but when I want to know the index of the selected item I have some problems. It returns me -1. I do the following in order to know the index of the item selected:

I use the property Strings[] wired to the 1D Array input of Search 1D Array and wire the combo box control to the element input. The output will be the index of the selected item.. but it returns me -1.. and then (if it works) I want to get the cluster of the selected item in the combobox, so I use the property StringAndValues[] of the combobox wired to the n-dimension array input of the block index array and I wire the index returned (index of the selected item that I have obtained previously) to the index input of the block index array in order to get the cluster (string and value) of the selected item.

How can I get the cluster (string and value) of the selected item in the combobox if the items of the comboxbox are string and value?

Thanks,

ToNi.
0 Kudos
Message 5 of 13
(3,114 Views)
I'm sorry. I must have been asleep at the keyboard when I gave you that last answer. You wire the Strings[] array and the combo box to the Index Array function and not the Search 1D Array. That will directly return the string value of the combo box.
0 Kudos
Message 6 of 13
(3,106 Views)
-1 means "not found" and the reason you're getting it is because your combo box has no value selected. Select one of the values and you will get its index. The rest of your plan sounds fine. I tried Dennis's suggestion and while being in the LV spirit, it doesn't work on my 7.1. Seems I found a bug in DK.

___________________
Try to take over the world!
Message 7 of 13
(3,103 Views)
Hi,

I want to do what I attach here but It doesn't work. Why?

Thanks very much,

ToNi.
0 Kudos
Message 8 of 13
(3,096 Views)
Big time bug. When I read it just now I forgot that he was using a combo box. I'm so used to enum and dialog rings;) Here's how it should be. This is okay when you use values of 1, 2, and 3. It gets a bit trickier with values that jump around which is why I almost always use an enum.

Message Edited by Dennis Knutson on 03-22-2005 03:17 PM

Message Edited by Dennis Knutson on 03-22-2005 03:17 PM

0 Kudos
Message 9 of 13
(3,096 Views)
It didn't work because the text coming out of the terminal is the value and you are searching the string array. Check the "Values match labels" box and then it will work.

___________________
Try to take over the world!
0 Kudos
Message 10 of 13
(3,087 Views)