LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I automatically add elements to enum contraol

Based on another function I would like to add elemets to an enum control automatically.

So for example one time the elements might be 1,2,3,6 another time 1,3,5,6,7

I would greatly appreciate your help on this

Thanks

 

0 Kudos
Message 1 of 10
(4,486 Views)

You can only modify an enum in edit mode. You could create two different enums and show one or the other according to state.

0 Kudos
Message 2 of 10
(4,483 Views)

You might want to use a Ring instead of an Enum if you need to change the items in the menu at runtime. You could have multiple enumerations. At run-time, pick the appropriate one, get the list of all the items in it (the GetNumericInfo function in the VariantDataType library will do it, under vi.lib\Utility\VariantDataType) and then write that list to the Strings[] property of a Ring.

0 Kudos
Message 3 of 10
(4,473 Views)

Hi nathand, could you please give me a sample code so I can completely understand how to do it

Thanks

0 Kudos
Message 4 of 10
(4,445 Views)

Sometinhg like this.

 

Thanks

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 10
(4,432 Views)

@Ranjeet_Singh wrote:

Sometinhg like this.


Why so complicated? Why the sequence? Why convoluted string operations? Why so many property node reads and writes?

 

Here's about the same...

 

     

Download All
0 Kudos
Message 6 of 10
(4,416 Views)

I did sequence because if he wants to verify with multiple times then older data shouldn't be there..

 

This is better than that one ofcourse..Thank you sir. 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 7 of 10
(4,406 Views)

@Ranjeet_Singh wrote:

I did sequence because if he wants to verify with multiple times then older data shouldn't be there..


Well, writing an empty array to the property node is useless, because it will get overwritten with the final array a nanosecond later. Too fast to see! So why do it?

0 Kudos
Message 8 of 10
(4,402 Views)

What I was thinking was this:

Enum to Ring.pngEnum to Ring image.png

0 Kudos
Message 9 of 10
(4,371 Views)

Got the point

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 10
(4,343 Views)