LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Array

Hi I need to create an array (in the front panel), consisting of only 8 elements. How do I limit the array index? Thanks

Message Edited by DonnieD on 02-03-2006 10:05 AM

0 Kudos
Message 1 of 8
(4,255 Views)

Hi Donnie,

If you only want the user to see 8 elements in the array, just resize it to show 8 elements, then deselect Visible Items > Index Display.  Now the user cannot scroll the array, and he will only see the 8 elements.

If this is not the answer you were looking for, please re-post with more details, and perhaps an example VI that explains your issue more clearly.

Good luck,

-D

0 Kudos
Message 2 of 8
(4,231 Views)
Hi Darren, The cluster element (control) of the array is fairly big, so I want to use the index to scroll; to be more user friendly. Is there no easy way to do this?
0 Kudos
Message 3 of 8
(4,222 Views)

Hi Donnie,

You can use a trick that was mentioned in another Dev Exchange post recently.  Specifically, don't show the array index on the array control, but stick a numeric control next to the array that controls the array index, and you can assign a minimum (0) and maximum (7) value to that numeric so that the user can only select the numbers 0 through 7.  In your diagram, wire the numeric to the IndexVals property of the Array (it's an array of index values, but you'll just have one index value if it's a 1D array).

Hope this helps,

-D

0 Kudos
Message 4 of 8
(4,216 Views)

It might be possible to use some property nodes for the array itself.  You can make your own indexing that will show what array element needs displayed and then do a check if they try to increment outside of the bounds.

0 Kudos
Message 5 of 8
(4,205 Views)

Hi Darren and Donnie,

See reply #24 in this thread

http://forums.ni.com/ni/board/message?board.id=170&message.id=127096

for one of JPD/Ben's Nuggets.

Let me know if you figure out how to clean up the code. Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(4,206 Views)
Ben, I never actually managed to get it right with 2D arrays. Look at the attached. At least in 7.0 the scrollbars are in front of the element and so after you put an element in the empty array there isn't any way to get to it. There doesn't seem to be any way to make them move to the back, either. I tried in the control editor, obviously, but that doesn't seem to work. Did you ever try this with 2D arrays or will I have to get 8 to have that?

___________________
Try to take over the world!
Message 7 of 8
(4,182 Views)

In LabVIEW 8.0 you could make an XControl that does exactly what you want ;).

Message 8 of 8
(4,165 Views)