This is a simple suggestion regarding returning all variant attributes from a variant in the correct data type if the name is left unwired but the default value is wired.
As you probably know, if you leave the name and value terminals unwired the "get variant attribute function" will return an array of names and variants for all of the variant attributes. If you wire the name or the default value then the node will adapt and return only a single value with the 'found?' output.
Here is a diagram to show you what I'm talking about:
Currently, if you leave the name unwired but wire the default value this results in a broken block diagram.
The reasons for this suggestion are as follows:
- Cleaner block diagrams - if you know all of the variant attributes are the same data type then you save the extra constant/variant to data node
- Possible performance improvements - maybe NI does (or can do) something to improve the performance/memory allocations if the data type is known and can be done within the SubVI
- I can't see a case where it would break compatibility other than perhaps a broken block diagram would no longer be broken if the default value was wired but not the name but the runtime functionality would remain the same
- As variant attributes are a very efficient and recommended way of doing key/value lookup tables I think this minor change will tidy things up nicely and if there are performance gains to be had under the hood by doing this then all the more reason to do it!
Thanks for reading and hope you'll +1 my idea!
LabVIEW Champion, CLA, CLED, CTD
(blog)