LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updation for enum control

hi,

      i am in need of one requirement in my current appliction.There is one enum control which has name of the material.That enum should get updation programatically.But programmatically it is not possible to update the enum unlike ring.can u give me any idea..

0 Kudos
Message 1 of 7
(3,507 Views)

You gave the answer in your question: use a ring. You can't update enums programmatically.

(Which case should a case structure connected to an enum execute if you add a new element?)

 

 

Message 2 of 7
(3,487 Views)

dan_u wrote:

You gave the answer in your question: use a ring. You can't update enums programmatically.

(Which case should a case structure connected to an enum execute if you add a new element?)

 

 


 

Right you are Dan!

 

Your reference to the case structure is the big "gotcha" associated with changing enums.

 

Now to just to explore the edges of the "LabVIEW World" ("There be dragons here.") there is a way to push this limit a bit but it can only be done under very specail controlled conditions.

 

IF

You are running in the developement environment (so that the code can be recompiled)

AND

All of the cases driven by the enums have a "Default case" defined,

THEN

You could create a "Launcher" that opens the typed def of the enum and write the "strings" and then save it before (this is important because you can't write the strings of an enum that is part of an app that is resreved to run) opening the app that uses the enum, and then run the app you COULD change the enum on the fly.

 

But under most situations the ring is the way to go. Smiley Wink

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 7
(3,482 Views)

Ben wrote:

 

IF

You are running in the developement environment (so that the code can be recompiled)

AND

All of the cases driven by the enums have a "Default case" defined,

THEN

You could create a "Launcher" that opens the typed def of the enum and write the "strings" and then save it before (this is important because you can't write the strings of an enum that is part of an app that is resreved to run) opening the app that uses the enum, and then run the app you COULD change the enum on the fly.

 

But under most situations the ring is the way to go. Smiley Wink

 

Ben


 

This is very true of course.

I just thought to give the quick answer that is - in most situations - the best solution Smiley Wink

 

 

 

Message 4 of 7
(3,479 Views)

dan_u wrote:
...

This is very true of course.

I just thought to give the quick answer that is - in most situations - the best solution Smiley Wink

 

 

 


Yup!

 

I just like to point out the loop-holes every now and then. Sooner or latter some nut-job (like CC) will jump through one and come back reporting amazing creatures they found in the rabbit hole.

 

"...take the red pill and find out how deep the rabbit hole goes." (Morphius, The Matrix)

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 7
(3,474 Views)

Ben wrote:

dan_u wrote:
...

This is very true of course.

I just thought to give the quick answer that is - in most situations - the best solution Smiley Wink

 

 

 


 

"...take the red pill and find out how deep the rabbit hole goes." (Morphius, The Matrix)

 

Ben


For anyone interested, here's a receipe for the red pill.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 6 of 7
(3,456 Views)

Raghupati

Any specific reason you wanted to use enum and not ring.

Ring can do the job for you.

Vinamra 

Message 7 of 7
(3,429 Views)