03-23-2011 06:29 AM
I am using LabView 2010 and would like to create a custom control, in which there are two ring controls (among other things).
The options shown in one ring menu should depend on what option is picked in the other ring menu.
How does one do that?
Solved! Go to Solution.
03-23-2011 06:32 AM
You could use an event structure to detect changes in the selection of the first ring.
Based on the new selection, use a property node to update the options in the second ring (e.g. strings and values property node).
That make sense?
Ian
03-23-2011 06:38 AM
Thanks for the prompt reply!
Your suggestion makes sense, however I need the change to occur both when the VI is running and when its not.
I also need this action to be embedded in the control, as I intend to use it in many VIs.
03-23-2011 06:39 AM - edited 03-23-2011 06:40 AM
@scf1984 wrote:
Thanks for the prompt reply!
Your suggestion makes sense, however I need the change to occur both when the VI is running and when its not.
I also need this action to be embedded in the control, as I intend to use it in many VIs.
mmm, you want this as well if the VI is not running? that's a strange ID...
03-23-2011 06:45 AM
Well, this is how I was taught to run the VIs here...
Set the parameters and run the VI.
Its intended to be a measurement procedure.
However, even if I change my design (which shouldn't be a problem at this point), how do I make sure this procedure is embedded in the control so I don't have to rewrite it for every VI?
03-23-2011 06:50 AM
@ABCPrograms wrote:
that's a strange ID...
Certainly is!
You could look into XControls. I can't help you much there, I don't think my rusty old LabVIEW version lets me use them.
As for use in multiple vis, there is no reason to embed the code and the controls together - you can copy and paste sections of code very easily between multiple vis. Or you could have a think about how a sub-vi could handle this so that you only have to drop the sub-vi into your code every time you want to use it.
03-23-2011 06:51 AM
Well the data that goes into the two rings will have to be initialised somehow... Or by constant array, or by reading them from file.
If you don't want to change your code, I would defenitly getting the string you want to get from file.
But still, to update the 2 rings, you will have to update the strings in the 2nd control on the fly.
FILE :
[OPTIONS]
Option1=...
Option2=...
[POSSIBLE_SELECTIONS]
Selection1.Parent=1
Selection1.Name=...
Selection2.Parent=1
Selection2.Name=...
This is how you could set up the file. where options are the items which your are going to put in the first ring.
Depending on that selection you will go fill out the names in the second ring depening on which parent is selected in the first ring
03-23-2011 07:31 AM
From the documentation I read, XControls seems to be the way about it.
Of course, I don't know the first thing about them - but no proble, I'll learn.
Thanks for the help!
03-23-2011 07:35 AM
I like your attitude! Go for it!
In case you change your mind, the attached shows a simple route to a solution - it doesn't embed the function in the control but it would be trivial to transfer it from one application to another. As Bjorn says, you might want to read in the strings from a file as an alternative to hardwiring them as constants in the vi.
Ian
03-23-2011 09:08 AM
This example actually helped me figure out what I need to put in the Façade VI of the XControl!
This is working out awesomely as I planned!!
Thanks!!!