Hi All,
Please see attached.
I'm trying to simplify a VI here that has a bunch of controls and wires by making lookup dictionaries for a specific data type. Example: Create a variant lookup table from an array of string references and their names, call it "system info".
The problem is that I can only group references of a particular type together for a lookup table - I end up making a polymorphic "ref array to dictionary" VI and this isn't flexible.
Is it possible to have a more generic VI that doesnt care what type of references I'm taking in?
Oh, P.S. I hate clusters.
Hey! Thanks a lot for the input.
After going down the path you sent me down, I believe I may have found an even easier way.
By right clicking on my ref in, apparently (havent ever played with this) I can select VI server class and just make it a generic control. Then I can wire anything I please right in to this subvi and my "ref array to dictionary" is no longer polymorphic!
WOOHOO
Thanks brah.
In the example shown, the 'To More Generic Class' function is completely unnecessary. The references will be coerced to a common class at the input of 'Build Array'
I disagree. I my opinion, the code is more readable without the 'To More Generic Class' functions. Even if you don't notice those coercion dots, there's nothing confusing about it.
There are cases where a latent bug may be caused by undesirable coercion, but this isn't one of them.
Here's a forum discussion link to coercion dot, so anyone can make their mind and you may add your though there.
http://forums.ni.com/t5/LabVIEW/Dealing-with-Coercion-Dots/m-p/926925/highlight/true#M416411
The simple example was to show that classes exist in LabVIEW, simple as that.
Michel
Not really. References are not "different things".
I get to decide what is the "same" (bundling is also putting different things together). The inability to programmatically cluster things is a huge disadvantage to clusters in addition to their slow lookup speed.