So, for beautification of the code Events get registered in a sub vi of it's own, and the ref is sent out as an Event Ref Indicator (ERI). Main program's event structure connects and all work well. (With a bunch of user events it's quite alot better looking this way)
One of the events use a type def for event types (which seems like a generally good idea).
If i change the type def, the Sub vi breaks and i need to recreate the ERI. Type def'ing the ERI doesn't help. I could send the commands as text with the error of spelling error (and possible miniscule performance loss with string comparison compared to type def).
Solved! Go to Solution.
Embedded within the event reference type is all of the type info about the events. When you change a registered event, the specific type of event reference changes.
There is no way to get an indicator to change to match the type of data feeding it; you just have to recreate the control.
Yes the contents of the event registration wire changes as new events are added or removed. Attempts to type-def it fail when the wires feeding it change. To work-around the behaviour I generally will keep the event registration node in the same VI as the event struture as illustrated below.
This way the wire never passes through a connector pane and the need for the type def goes away. I have come to rationalize this approach since the sub-VI can now clearly document which events are monitored in the sub-VI "at-a-glance". For example, the above sub-VI handled the work associated with "collection" functions so if I find this VI while working on a collection task, I know I am in the right area.
another "gotcha" that I should mention (that I would like to cite the source but am restircted in saying who so I have to be happy with saying the gotcha was not my discovery but someone elses ).
The "gotcha" is;
If you delete an input to the Event Registration the event reg wire changes and (here is the gotcha) all of the events get scrambled!
So make sure you add coments to each event case describing what they do BEFORE you change that event registration node!
At least the comments will let you put thing back the way they should be .