VI Analyzer Enthusiasts Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Test - Forked Event Reg Refnum Wire

This test returns a failure for any event registration refnum wire (or a cluster wire containing event registration refnums) that has more than one sink:

forkpic.png

It is generally considered bad practice to wire an event registration refnum wire to multiple event structures.

This test is saved in LabVIEW 2013. Follow the instructions here to install and use this test.

Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman
Comments
Member wirebirdlabs
Member

"It is generally considered bad practice to wire an event registration refnum wire to multiple event structures"

Minor correction: it is unequivocably a terrible idea to bind this registration simultaneously to multiple Event Handler Structure.

Though, it's possible to unbind from one Handler and rebind with another, so long as no time overlaps where both handlers are bound to the same registration.

To see this in action, there are a few demonstrations of these two principles at: https://github.com/wirebirdlabs/LabVIEW-User-Events-Tips-Tricks-and-Sundry

In that repo, 04 - Demonstration - Effect of Branching Event Registration.vi and 03 - Demonstration - Dynamically Rebind Event Handlers.vi demonstrate these two principles.

Thanks for the test, Darren! Static code analysis FTW

Member Ben_Phillips
Member

Jack, this is a _fantAstic_ demo. 

I happened to just stumble upon it from the most unlikely place...

Member wirebirdlabs
Member

Ben_Phillips wrote:


                       

Jack, this is a _fantAstic_ demo.


                   

Thanks!

Contributors