With how event source references are currently handled, it is not possible to add any additional event sources to an existing Even Registration Refnum. The user is required to know the number of events needed and statically configure the Register for Events block at the beginning. The Register for Events block is resizable when you have not wired an input for the Event Registration Refnum, as shown,
But this presents a problem whenever you are working with a preconfigured refnum. If you're working with an application that defines the events within a subVI and then passes out that Event refnum, there is no way to append new events to that refnum.
The new Register for Events is not resizable and there is no way to combine the previous refnum with a new refnum you have created. This really limits the capability to expand and continue using the refnum throughout your code.
The only ways to work around this would be,
Preallocate many readdressable events that you can later overwrite,
- Use a datatype that has multiple elements (cluster/array) and use the different array indices as needed
- Preregister many event sources on first creation of the refnum, and then rewrite over those sources later
The last way to approach would be to just create another Event structure to handle the new refnum.
Has anyone else run into something like this and has a recommended way to approach? Any other approaches and recommendations to help make the Event refnum more flexible would be great!