05-30-2018 03:52 PM
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.
05-30-2018 04:22 PM
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". 😉
05-30-2018 04:42 PM
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.
05-30-2018 06:34 PM
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.
05-30-2018 10:37 PM
There is a way to "fix" it (though some people say you shouldn't do it):
Note: This also works with ring constants.
05-31-2018 06:51 AM
@paul_cardinale wrote:
EnableStrictTypedefConstantConfiguration=True
Never new what that key was for. Thanks, although indeed it might not be the way to go..
05-31-2018 09:32 AM
@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.
07-03-2018 07:09 AM - edited 07-03-2018 07:10 AM
@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