LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making sense of Labview arrays

Solved!
Go to solution

I am trying to wire a DAQ assistant for digital IO output. I used it to create an array for the data and it created what appears to be a two dimensional array of booleans, despite the context help claiming it's one-dimensional. I manually created a one-dimensional array of booleans and that looks correct.

array1.png

It also appears that merely incrementing the index on the front panel of the array automatically creates more elements. Is that correct? Is it possible to remove them?

 

I have another (example?) vi that writes to digital lines and it too is using what appears to be a two-dimensional array, but what else is odd about it is that it looks totally different in the diagram. It appears as just TF. Why does it appear differently from ones I created above?

array2.png

0 Kudos
Message 1 of 6
(3,347 Views)
Solution
Accepted by topic author mauricev

Post your VI.

 

All of your images look like 1D arrays of booleans to me.

 

I don't know what you mean by incrementing the index adds elements.  It will just move the lower numbered ones off the edge and bring higher number ones on.  If the element doesn't exist, it will look greyed out, unless you happen to click on it and give it a value.

 

And in your one image, that is just the terminal on the block diagram.  What do you think it would look like?  You've got 36 posts on the forum so it doesn't seem like you'd be THAT new of a LabVIEW user.  But your questions make me think you haven't taken any LabVIEW tutorials.

0 Kudos
Message 2 of 6
(3,314 Views)

2D arrays have two indexes. All your examples have only one index, so they are obviously 1D.

You can make a 2D-array out of an 1D-array by right-clicking on the index and selecting Add Dimension.

You can then expand the view, grabbing the bottom-right corner of the last visible element. And verify that 2D arrays are indeed displayed as a 2D "table" of elements as one may expect.

About the thick or thin terminal on the diagram, right click on it checking or un-checking View as Icon and see what happens.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 3 of 6
(3,249 Views)

@pincpanter wrote:

2D arrays have two indexes. All your examples have only one index, so they are obviously 1D.

You can make a 2D-array out of an 1D-array by right-clicking on the index and selecting Add Dimension.

You can then expand the view, grabbing the bottom-right corner of the last visible element. And verify that 2D arrays are indeed displayed as a 2D "table" of elements as one may expect.

About the thick or thin terminal on the diagram, right click on it checking or un-checking View as Icon and see what happens.


Even easier.  Just drag the bottom border of the index area downwards and it will add dimensions.

0 Kudos
Message 4 of 6
(3,243 Views)

Ah, so an array can display one or more of its elements at once. It just looks confusing to be displaying a specific index value while at the same time displaying that index and others. 

 

I also see that the TF icon has [] to indicate it's an array. Thanks for letting me know about displaying it as an icon.

0 Kudos
Message 5 of 6
(3,222 Views)

Concepts of visualizing arrays can be a bit difficult for new developers.  Have you gone through any LabVIEW videos on youtube?  Or the self paced online training (for those with SSP and students)  I feel like they probably give a good explanation of the concepts.

0 Kudos
Message 6 of 6
(3,216 Views)