Showing results for 
Search instead for 
Did you mean: 

Initializing both dimensions of an Array

is it possible in LabVIew to initialize a two-dimentional array.

What I mean by that is that..- like in the "initialize array" command we can initialize one-dimension of the array, is it possible both the dimensions.

Well, what I'm trying to do is to segregate an output string into certain components whom I hope to display in a two-dimensional array. I want to determine both the dimensions of the array by counting the number of variables in the output string.


I figured out how to count the length of the array's two dimensions, but don't know how to initialize both the dimensions of the array.


Any help would be much appreciated.



0 Kudos
Message 1 of 12

"Initialize Array" is resizeable.  Click and drag the index terminal.




"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
Message 2 of 12

thanks!! that worked just fine.

One more thing, now how do I display a part of the output string that I've identified and distinguished from the rest of the string at a particular location in the two-dimensional array.???


thanks in advance.



0 Kudos
Message 3 of 12

ReplaceArraySubset ist your friend!

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12

kudos are granted Smiley Wink

0 Kudos
Message 5 of 12

I'm having trouble using the Replace-Array-Subset sub-VI. I want to use this commmand inside 2 for-loops (one for-loop is inside the other one).


But when I try to do this it gives me an error (see attachment). When I connect the same sub-VI in only one for-loop or outside the for-loop(s) i get no error.


What should I do now?? Which other command can I use???

0 Kudos
Message 6 of 12

Hi Rajat,


there is no attachment...


But I guess you have autoindexing enabled on both FOR loops! Switch off the autoindexing of the in-/output tunnels and you should be fine...

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 12

i can not attach the screenshot, because the .jpg file is larger than the size permitted on this forum.

0 Kudos
Message 8 of 12

How do I turn off the auto-indexing in the for-loop????

0 Kudos
Message 9 of 12

the error I'm getting is:


"You have connected a Scalar type to an array of that type. the type of source is string. the type of sink is 1-D array of double. (64-bit real (15 digit precision))"

0 Kudos
Message 10 of 12