03-14-2024 03:29 PM
At edit time, type info, including the name, is carried through wires; so this works:
Now in a malleable VI, I would like to get the name of the data that connects to the SubVI that calls the malleable.
I.e. if the above code were a .vim, I would want the name, not of the .vim's FP terminal, but the name of the data that's wired to the "My String" terminal of the SubVI that calls the .vim.
I think it should be possible because "Get Type Information.vi" is doing it; but I can't figure out a way to do it.
03-14-2024 04:05 PM
I haven't personally messed with wire labels, but is this idea what you're looking to do?
03-14-2024 04:35 PM
Have you seen this thread? I think I had the same issue as you.
03-15-2024 04:12 AM
I've once stumbled upon the same problem while wanting to develop a generic logger VI.
I wish VIMs were truly equivalent to just dropping their code in a sequence structure in the caller. It would allow getting wire names. It would also allow containing XNodes, VI property/invoke with unwired reference, static references "This VI" and "This Application" (references to the current VI would redirect to the caller VI), accessing class private data (if the vim belongs to the class). It would only forbid nodes that refer to the front panel of the vim, such as pane and control static refs, implicitly linked properties/invokes and locals.
03-18-2024 05:23 AM
@paul_cardinale wrote:I think it should be possible because "Get Type Information.vi" is doing it; but I can't figure out a way to do it.
Get Type Information isn't a malleable VI.
The input in converted to a variant, and that conversion includes giving the variant a label of the wire.
Sadly, the .vim converts all inputs, so there will be no wire to variant conversion..
You can make the .vim assert if the wired type isn't a variant, but there's no way to stop the control from adapting. So you'd have to put a 'To Variant' on the wire yourself.
@BertMcMahan wrote:
I haven't personally messed with wire labels, but is this idea what you're looking to do?
Yes, exactly that.
It got declined on the first day, but I think there would have been some kudos if it was left open.
03-18-2024 05:45 AM
Ironically, generics can do this (adapt one input, not the other)...
I wouldn't use them in production though. Although I can't find anything wrong with them, they are not supported...
03-18-2024 08:00 AM
BTW, shameless plug (but on the topic of malleable VIs):