From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

"You have connected two terminals of different types" Index Array won't work

So I have a 3D array finally. Now I want to index that array and display the contents of a certain element on a new array. When I index a 2D array, this method works just fine. But when I change it to 3D array, Labview gives me the following error:

 

You have connected two terminals of different types. The type of the source is string. The of the sink is 1D array of string.

 

So I'm assuming the 1D arry it speaks of is referring to the indicator array that the index should spout out the contents of the element I'm looking for. And the source string is the 3D array. I've tried changing the dimensions of the 1D array to match that of the source 3D array, but nothing is working yet. I've attached a pic of the problem below.

0 Kudos
Message 1 of 9
(4,266 Views)

You gave the Index Array 3 indecies, which correlates to a single item.  Therefore you get a scaler string out.  Leave the last index unwired and you will get a 1D Array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(4,257 Views)

This might be another problem of understanding what the data represents.  You are telling the code that you have a 3D array, and you want to pull out a single element, a scalar string, by specifying the row, the column and the page to find the data.  But then you are trying to display this single item into a indicator that is a 1D array.  You are trying to display a single cell of data, into a column of data.  Either replace your 1D array with a scalar string, or when you index your array specify a row or column to display.

0 Kudos
Message 3 of 9
(4,251 Views)

When you wire all three indexes of a 3D array to Index Array the output is a single element, in this case just a string. Change your indicator to a string rather than an array of strings.

 

Lynn

0 Kudos
Message 4 of 9
(4,249 Views)

Oh and to be clear, in the 3D host array I have the string called "test1" established on page 1 of the 3D array, and in which index array should spout that out to the 1D array. I dunno. I think I'm getting my rows and columns backwords when I set up the index array.

0 Kudos
Message 5 of 9
(4,245 Views)

Well I changed it to a string instead an array of strings (I tried this before but it wouldn't allow that wiring, but now it works... Not complaining!) Anyway, it all linked up but when I ran the VI the string indicator remained blank. I still think I have a problem with my index setup. But thanks for the suggestion.

0 Kudos
Message 6 of 9
(4,234 Views)

Yep, that confirmed it. Changing the string array to just a string indicator did the trick. And I did have my index array function backwards. For whomever wants to know, the top most index 0 is Page, index n-1 is Row, and index n-2 is Column (I'm pretty sure). So thanks again Lynn and everyone who helped out.

0 Kudos
Message 7 of 9
(4,227 Views)

That information is in the detailed help file for Index Array. Just click on the link at the bottom of the Context Help window. Always keep the Context Help window turned on while programming. It will help you find answers to a lot of questions.

 

Lynn

0 Kudos
Message 8 of 9
(4,220 Views)

@ShogunOrta wrote:

Oh and to be clear, in the 3D host array I have the string called "test1" established on page 1 of the 3D array, and in which index array should spout that out to the 1D array. I dunno. I think I'm getting my rows and columns backwords when I set up the index array.


Why are you trying to show a single item with an array?  Just use a string indicator.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(4,217 Views)