LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you prevent a user from creating a new array elements while also displaying the scrollbar?

Hello,

 

On my FP, I have an array control that can hold more elements than can fit on the screen, so I am showing the control's scrollbar to allow access to all elements.  Unfortunately, when the user scrolls to the end, they see 1 unfilled array element... If the user clicks on this element, then it grows the size of the array, which I do not want to have happen.  Is there a way to prevent LabVIEW from displaying the extra element while also showing the scrollbar?

 

(As a work-around, I can use the Event Structure to detect a value change, and if the array size changes, I can revert the array back to the "OldVal", but I'd prefer not seeing the unfilled element in the first place.)

 

Thanks,

Alan

--------------------

Alan Blankman, Technical Product Marketing Manager and LabVIEW Developer
LeCroy Corporation
800-553-2769 x 4412
http://www.lecroy.com
alan.blankman@lecroy.com
0 Kudos
Message 1 of 11
(3,681 Views)
  • You could make your own Xcontrol.
  • Hide the array scrollbar and index display and place an scrollbar from the numeric palette. Change the range of the scrollbar to the desired valid range and write to the index property of the array control to scroll it.

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 11
(3,655 Views)

Here's an example:

Message Edited by altenbach on 05-13-2009 05:28 PM

LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
Message 3 of 11
(3,651 Views)

Wow... I just spent a bit of time designing a new control that had an array of clusters with the scrollbarbecause I had more items than would fit onscreen.  When testing it, I encountered the 'extra element' problem (I had never used scrollbars on arrays before, and did not imagine that this would be how they worked).

 

I'm very disappointed in NI's implementation of the array scrollbar. I can think of NUMEROUS applications where one would want to do what we are doing - create a dynamic list of elements, and allow the user to view/select ONLY THOSE ELEMENTS. One should not have to resort to using an X-Control to obtain a 'scroll only to last element' behavior.

0 Kudos
Message 4 of 11
(3,494 Views)

What about disabling the array control with a property node?  Does the user have to click on the array for any reason?  If it is just for display, can you use an indicator instead of a control?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 11
(3,470 Views)

Or customize the array...

 

1) Find a slider that you would like to use for the slide.

 

2) Set is as U32 and set range action to Coerce if out of range.

 

3) Customize >>> Save as a control.

 

4) Pop-up on the array container and hide scroll bar but make sure index display is still shown.

 

5) Customize the Array container Goto blow-torch mode.

 

6) Pop-up on the index control and choose "Replace" with the control you saved in step #3 above.

 

7) Exit blow-torch mode and close the Control editor and replace the control you stated with with the new version.

 

😎 Pop-up on the new scrool bar and create a property node for the range.

 

9) Run the VI and after the property node executes, you have an array control where you can limit the range of values.

 

 

A quick hack of that is attached.

 

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 11
(3,461 Views)
Yes, it is a single cluster containing (among other things) an array of cluster controls in which a button in one of the clusters must be selected.  I'm just going to remove the scrollbar from the array (nice feature) and add a scrollbar control to the cluster to make the array do what I want.  Maybe someday NI will make the array scrollbar more useful.
0 Kudos
Message 7 of 11
(3,460 Views)

Post colision!

 

There is still another way. Smiley Happy

 

Notes:

 

You can make the top of my slider 0 and the bottom 5 or what ever.

 

You can alos pop-up and hide the scale.

 

Also not that NO extra code is required in this example.

 

Ben

Message Edited by Ben on 05-21-2010 03:00 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 11
(3,448 Views)

Ben, this is a nice idea.  I have run into a problem though: I can only replace the index control with an old-fashioned slider, not an actual scroll bar control - LabVIEW just beeps at me when I try it.  So, the result looks strange.  The only way I've been able to get an actual scroll bar is to build an XControl.

Message 9 of 11
(2,728 Views)

Thank you Code Ferret!

 

I logged SR# 1775861 to verify the above procedure still works.

 

If I hear something I will update.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 11
(2,713 Views)