11-15-2011 07:56 AM
Solved! Go to Solution.
11-15-2011 08:02 AM
You'll need to use a ring or combo box instead of an enum if you want to hide items. The combo box may be more useful, as it would be easy to convert into your master enum using a scan from string.
11-15-2011 08:03 AM
English: You can't use an enum. Use a menu ring instead. You can change the list of items in a menu ring at run-time. An enum's values cannot be changed in the run-time environment, since that requires recompilation.
French (c/o Google Translate): Vous ne pouvez pas utiliser une énumération. Utiliser un anneau de menu au lieu. Vous pouvez modifier la liste des éléments dans un anneau de menu lors de l'exécution. Un enum valeurs ne peuvent pas être modifiés dans l'environnement d'exécution, car cela nécessite une recompilation.
11-15-2011 08:16 AM - edited 11-15-2011 08:25 AM
okay I'll try with both (combobox and ring),
thanks a lot for answering 😜
[edit] I'm trying with the ring, but can't find a property node which allows to add or remove items... ?
11-15-2011 08:56 AM
Both the ring and combo box have the Strings [] property and the Strings and Values [] property.
For the ring, if you leave it as the same representation as the enum, you can use Strings and Values to have the ring skip values. This way, you can typecast it to the enum to get your original enum back.
11-15-2011 09:06 AM
now everything is working fine, thanks a lot guys !
11-16-2011 05:14 AM
actualy I've got a situation :
the parameters of each measure are bundled in a cluster, and all the clusters (one for each measure) are bundled in an other cluster, which is sent to a SubVI which performs the measurements.
Since i changed the Enum of "range" to a Ring, it is properly recognised as a ring in my main VI (representation "Vlb"), but in my SubVI it is still recognised as an Enum (representation "<>") although I replaced the input cluster of the SubVI by the new one...
does someone has an explanation ?
I hope my English is understandable...
11-16-2011 09:04 AM
You'll probably need to post some code and/or screen captures.
11-16-2011 01:07 PM
Replacing the input cluster should have taken care of the problem, but you may also need to change every place inside the subVI where the enum was used.
If you have not yet learned about customizing controls, in particular creating typedefed controls, this is a good time to learn. If you had made your cluster a typedef before using it all over your program, then when you change it, the change automaically is applied to all instances of your cluster.
As Matthew said, please post your code.
Lynn
11-17-2011 02:55 AM
okay here are 2 screenshots (I can't post all my code, I think the company I'm working for won't like it ^^).
you'll probably think that my code is not well done (that's what I think.. the parameters in clusters in an other cluster ... my VI does'nt fit in the window ^^) but I didn't find any other solution to do it...