LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to dynamically change enum file on LabVIEW

So far we are able to change ring value dynamically with LabVIEW but not for enum with .ctl files. Is there any effective method to dynamically edit the contain of the enum using LabVIEW?

0 Kudos
Message 1 of 8
(284 Views)

Hi skykong,

 


@skykong wrote:

So far we are able to change ring value dynamically with LabVIEW 


Yes.

 


@skykong wrote:

Is there any effective method to dynamically edit the contain of the enum using LabVIEW?


Nope.

Enums are defined at edit time (as they define the datatype).

Changing them requires to recompile your executable - which isn't possible at runtime…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(279 Views)

You can, but the Enum must not be reserved for execution.

This example works as long as no running vi uses the ctl:

editenum.png

Of course, the file MyEnum.ctl must exist already.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 8
(262 Views)

Great! Can you provide the vi for references? Thanks.

0 Kudos
Message 4 of 8
(253 Views)

@skykong  ha scritto:

Great! Can you provide the vi for references? Thanks.


It's a snippet. Save it as a picture (.png) and then drag it into a Block Diagram.

Of course, you need LV>=2021

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 8
(247 Views)

@pincpanter wrote:

You can, but the Enum must not be reserved for execution.

This example works as long as no running vi uses the ctl:

editenum.png

Of course, the file MyEnum.ctl must exist already.

 


Maybe we should take a step back and ask why updating a ring is not sufficient?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 8
(230 Views)

This method won’t work because this only workable if execution is stop. Is there any method that work with executable is continue running?


 

0 Kudos
Message 7 of 8
(60 Views)

@skykong wrote:

This method won’t work because this only workable if execution is stop.


This is what others were meaning when they said:

 

@: "Enums are defined at edit time (as they define the datatype).

Changing them requires to recompile your executable - which isn't possible at runtime…"

 

and

 

@"the Enum must not be reserved for execution.

This example works as long as no running vi uses the ctl"

 

 


@skykong wrote:

Is there any method that work with executable is continue running?


Enums by definition are not editable at runtime. If you want a drop-down list with items settable at runtime, you have to use either a Ring (numeric data type) or a Combo Box (string data type).

 

Regards,

Raphaël.

Message 8 of 8
(41 Views)