LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UI-Triggered Event vs. Value (Signaling) Event?

Solved!
Go to solution

@Ulib, to expand further:  my top-level application passes a reference to any control type on its front panel (e.g. very generic and type-erased) down to a subVI. Within that subVI I write a new value (as variant type) back to that control via a Val(Sgnl) property node, and LabVIEW triggers the specific Value Change event for that control which was registered in my top-level application.  Voila!... my SubVI doesn't need to know anything about the actual type of the passed reference and is completely reusable and not coupled to the exact types in my top-level application. 

 

I don't know of a way to achieve this with a UE-based approach, because there isn't a generic UE type which can be invoked with a variant payload while having LabVIEW automatically cast the value back to the concrete type so it can be handled elegantly.  I suppose I could use a UE with payload for the value (as variant) as well as additional payload which defines the exact type (very difficult when complex types like clusters are involved), so that in the handler I can explicitly cast it back to the correct concrete type and then re-handle it in yet another UE (after bundling additional information about the event source)... but this is tons of extra work to achieve the type erasure that LabVIEW already has built-in when it automatically handles a Val(Sgnl) write as the concrete type when passed a generic reference and variant data. 

0 Kudos
Message 11 of 12
(27 Views)
0 Kudos
Message 12 of 12
(20 Views)