LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RingControl, ListBoxControl and SelectionEvents

Hallo,

I'm using LV5.1.1.
Is there a way that a ListBoxControl, a MenuRing or a DialogRingControl
doesn't output anything, as long as I've not selected anything. I put a
RingControl in a WhileLoop, it outputs the first item, although I haven't
selected it. How can I make the RingControl stop the programflow at this
point and wait with the execution.

Can I select the item, which should be displayed first in a RingControl. In
other words: Can I programmatically adjust a default in a RingControl ?

Thanks for your help

Oli
0 Kudos
Message 1 of 4
(2,857 Views)
The controls will always have an output but what you need to do is test the output for anything other than the default. Put the selection inside a while loop and terminate the while loop is not zero (-1 for a list box). Make the first item in a menu ring or dialog ring something like "None" or a blank line. You can set the default by using a local variable before the while loop starts.
0 Kudos
Message 2 of 4
(2,857 Views)
Oli;

About setting default values at run-time. I think one of the best alternative is to create a text file to store, modify and retrieve the desired default values. When the VI start, it read the text file and modify the controls initial values. Then, to set new defaults, include a button in your VI like "set new defaults", and when pressed it modify the text file with the new values.

Doing a search in "defaults" I found more adequate methods for implementing this approach. In a recent posting, Rejean Lafortune pointed out to an article with title "Remembering Control Values". The link to the article is:

http://www.ltrpub.com/pdf/excerpts/AEremember.pdf

The discussion thread is:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000
80000004C180000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

In another related discussion, Johannes Niess mentioned that LabVIEW allows you to read and write .ini files. The thread of that discussion is:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000C1010000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

I'm going to try that approaches too.

Best regards;
Enrique Vargas
www.vartortech.com
0 Kudos
Message 3 of 4
(2,857 Views)
Thanks for all the nice answers and ideas. I've already had that WhiliLoop
and CompareWithSomething in mind, too. But I hoped that LV provides some
more professional mechanisms like this. In Java you have AdjustmentEvents
and SelectionEvents, would be nice, eh ?
Does LV 6i provide more of this ControlEvents stuff?

Anyway thanks and best regards to all of this newsgroup

Oli
Oliver Friedrich schrieb in im
Newsbeitrag: 3ac47951@newsgroups.ni.com...
> Hallo,
>
> I'm using LV5.1.1.
> Is there a way that a ListBoxControl, a MenuRing or a DialogRingControl
> doesn't output anything, as long as I've not selected anything. I put a
> RingControl in a WhileLoop, it outputs the first item, although I haven't
> selected it. How can
I make the RingControl stop the programflow at this
> point and wait with the execution.
>
> Can I select the item, which should be displayed first in a RingControl.
In
> other words: Can I programmatically adjust a default in a RingControl ?
>
> Thanks for your help
>
> Oli
>
>
0 Kudos
Message 4 of 4
(2,857 Views)