08-13-2025 11:47 AM - edited 08-13-2025 12:00 PM
Hi,
While developing some malleable VIs to deal with user events, I suddenly hit a brick wall:
There is no way (that I know of) to get the data type inside a user event!
When I say get the data type, I don't want to get it as a variant, but as a strict type through data type propagation.
You can easily get the contained data type for most strictly-typed reference types (here for example with a contained boolean):
...but trying a similar approach with user events seems impossible in the general case.
Here it works if the user event contains a scalar named exactly "Data":
...but it fails if the element is named differently.
It is even harder if the user event contains a cluster:
Since the event data node automatically unbundles top-level cluster elements, it seems impossible to have a code that works for all data types.
Any idea on this?
Regards,
Raphaël.
08-13-2025 02:13 PM
Maybe this thread will give you some ideas.
08-13-2025 03:23 PM
The only thing I can think of is to make an XNode instead of a malleable (but you probably don't want to do that).
08-14-2025 02:32 AM
08-14-2025 03:05 AM
@paul_a_cardinale wrote:
The only thing I can think of is to make an XNode instead of a malleable (but you probably don't want to do that).
Yeah, but not enough time at the moment to dive back into XNodes, plus the fact that they cannot be placed in malleable/inline VIs is still an annoying drawback for me.
My original idea was to have a malleable VI that takes a cluster of user events (refnums can be invalid, they are just used to get the data types), then creates the user event refnums appropriately and outputs the same cluster with the newly created references filled in.
I guess I'll give it a try when I have more time...
Regards,
Raphaël.
08-14-2025 01:23 PM
@raphschru wrote:
@paul_a_cardinale wrote:
The only thing I can think of is to make an XNode instead of a malleable (but you probably don't want to do that).
Yeah, but not enough time at the moment to dive back into XNodes, plus the fact that they cannot be placed in malleable/inline VIs is still an annoying drawback for me.
My original idea was to have a malleable VI that takes a cluster of user events (refnums can be invalid, they are just used to get the data types), then creates the user event refnums appropriately and outputs the same cluster with the newly created references filled in.
I guess I'll give it a try when I have more time...
Regards,
Raphaël.
I think that the only thing that's going to work is to forget using a malleable, and put all of the functionality inside an XNode.
08-16-2025 01:05 PM
Here's another possibility (but it's a bit kludgy):
In your project's buildspec, set up a pre-build action that finds all instances of your .vim and fixes them up.