07-06-2018 03:54 PM
Hello everyone!
I initialized a 256 x 2048 2D array, but every time the while loop adds new data the two dimensions of the array keeps switching. For example, the indicator on the array size shows that it is 256 x 2048 array one second and 2048 x 256 array the next second. Every time it switches it adds the data to both dimensions - once in x-dimension and once in y-dimension, so I ended up with a display that plots in both x-axis and y-axis at the same time. Did anyone come across the same problem? If so, how should I fix it?
07-06-2018 04:38 PM - edited 07-06-2018 04:41 PM
Hard to tell without seeing some code. can you please attach your VI (or a simplified version that still shows the symptoms). Probably trivial to solve.
Are you using "insert into array" (wrong) or "replace array subset" (correct)?
07-06-2018 04:42 PM
I was using insert array to insert 1D array of 256 x 1, and the array size is supposed to change in one dimension (for example: 256 x 2048, 256 x 2049 ... ), but right now it's changing in both dimensions (for example: 256 x 2048, 257 x 2049, 258 x 2050 ... ).
07-06-2018 04:47 PM - edited 07-06-2018 04:49 PM
Again: SHOW US YOUR CODE!
In ther original message, the array size did not change, just the transposition. Now you are increasing the size?
(We need to know how you are doing it, not what you observe. Is everything hooked up correctly, e.g. the index terminals? Any transpose operation. Are you trying to insert a row or a column? At the beginning, the middle, or the end?)
07-06-2018 04:57 PM - edited 07-06-2018 04:58 PM
It's part of a much larger program so I took a screenshot of parts most relevant to the problem The first image is when the array was first initialized and the second image is when the array is inserted. I didn't use any transpose operation before inserting into array, and I was trying to insert a 1D array into the column at the end of the array. I tried putting a constant for the index in the insert array function but that didn't solve the problem ... I just started learning labview two weeks ago, I apologize for my descriptions being vague.
07-06-2018 05:01 PM
07-06-2018 05:05 PM
Also right now the picture shows that I initialized a 256 x 256 not a 256 x 2048 array because I changed it very recently, but it still has the same problem as it was with 256 x 2048 array. Thank you for being patient with me.
07-06-2018 05:07 PM
@minmin1004 wrote:I didn't use any transpose operation before inserting into array, and I was trying to insert a 1D array into the column at the end of the array. I tried putting a constant for the index in the insert array function but that didn't solve the problem ...
The index of the last column changes with every insertion, so don't use a constant!
To insert a column you need to wire the lower of the two index inputs. Did you?
It is typically much more efficient to append rows instead of columns, then you can even use "build array".
07-06-2018 05:11 PM
Thank you for your feedback! I did wire the lower of the two index inputs to insert into column. But I'll try switching the dimensions and then adding it to column. Also, what would you recommend for indexing if not a constant?
07-06-2018 05:12 PM
@minmin1004 wrote:
Thank you for being patient with me.
I am tired of looking at truncated pictures that don't show anything useful. We have no idea where the wires com from and where they are going. Boil it down to a small program and attach that. We cannot help you if you spoon-feed us information a few bits at a time.
What;s with all the coercion dots? If you don't wire the indices, you'll insert a column, not a row.
There is a transpose operation and you said there isn't...