LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combo Box Typedef does not Auto-Update

I have a combo box typedef that I place around on my diagrams that I'd like to update frequently. However, it doesn't auto-update - I add new items to the typedef, "apply changes" and save and the typedefs in my diagrams don't Auto-Update. Tried strict types as well. Using LabVIEW 2016. This old thread doesn't help:

 

https://forums.ni.com/t5/LabVIEW/combo-box-auto-updating/td-p/250457

 

Hoping something new has been developed/fixed in the last decade.

0 Kudos
Message 1 of 8
(4,059 Views)

Actually "that old thread" does help, because it links to this, which explains why they aren't supposed to update.  Rings on the block diagram won't update, either, and for the same reason.

 

So don't wait for a "fix" cuz it ain't "broke".  😉

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 2 of 8
(4,049 Views)

I made a quick scripting VI a while ago that updated all Ring constants on a VI's block diagram with the current values in their associated type definition.  You could probably use it for your Rings and maybe update it to also work with your combo boxes and on multiple VIs instead of one.

 

I made it in 2015 but it should work in 2016 no problem.

Message 3 of 8
(4,044 Views)

Since my dynamic list of 80 list items were in an spreadsheet, I wrote a VI to read the spreadsheet and create a 1D array of my items (strings). I then wired the string array into the "Strings" property of a Text Ring. I then replaced the Text Ring with an Enum and like magic all of my 80 items went from the Text Ring to the Enum - saving me having to type all of those in but costing me a lot of Googling and conversations resulting in a net gain of 38 seconds. I then created a Typedef out of the Enum. In the future as I make changes here and there I'll have to manually edit the Enum or redo the process from the top and replace the old Typedef.

 

Thanks you for your ideas.

 

0 Kudos
Message 4 of 8
(4,018 Views)

There is a way to "fix" it (though some people say you shouldn't do it):

  1. Add this line to labview.ini: EnableStrictTypedefConstantConfiguration=True
  2. Make sure your typedef is strict
  3. For each instance of the combobox on a block diagram, right-click and select "Act as Strict Typedef Constant"

Note: This also works with ring constants.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 8
(4,002 Views)

@paul_cardinale wrote:
EnableStrictTypedefConstantConfiguration=True

Never new what that key was for. Thanks, although indeed it might not be the way to go..

0 Kudos
Message 6 of 8
(3,983 Views)

@StuartWilson wrote:

Since my dynamic list of 80 list items were in an spreadsheet, I wrote a VI to read the spreadsheet and create a 1D array of my items (strings). I then wired the string array into the "Strings" property of a Text Ring. I then replaced the Text Ring with an Enum and like magic all of my 80 items went from the Text Ring to the Enum - saving me having to type all of those in but costing me a lot of Googling and conversations resulting in a net gain of 38 seconds. I then created a Typedef out of the Enum. In the future as I make changes here and there I'll have to manually edit the Enum or redo the process from the top and replace the old Typedef.

 

Thanks you for your ideas.

 


Your post was a bit confusing, but in case you haven't realized it, once you converted to a typdef'd enum, your constants should always auto-update.  For rings, I have found that if I replace the ring control with an enum, apply the changes, then replace that with a ring again, then save, that works.  I haven't found anything that will easily do it for a combo box because the data are strings, not numbers.  The only reason why it works for rings, I suspect, is because the data types are close enough to be coerced.

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 7 of 8
(3,973 Views)

@Kyle97330  wrote:

I made a quick scripting VI a while ago that updated all Ring constants on a VI's block diagram with the current values in their associated type definition.  You could probably use it for your Rings and maybe update it to also work with your combo boxes and on multiple VIs instead of one.

 


Using your vi  (thank you)  I made a variant for Combo Boxes,  saved in LV2015

 

 

Message 8 of 8
(3,879 Views)