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.
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.
06-16-2015 09:38 AM
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.
06-16-2015 09:42 AM
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.
06-16-2015 09:43 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-16-2015 09:44 AM
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
06-16-2015 09:45 AM
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.
06-16-2015 09:49 AM
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.
06-16-2015 09:56 AM
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.
06-16-2015 09:59 AM
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
06-16-2015 09:59 AM
@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.