06-03-2019 09:36 AM
How could I get the list of all dynamic events registered in an event structure?
I need at least the names of the events as shown in the context help (e.g. "Mouse Down - My Controls" or "My User Event").
06-03-2019 09:40 AM
@awilliotAcutronic wrote:
How could I get the list of all dynamic events registered in an event structure?
I need at least the names of the events as shown in the context help (e.g. "Mouse Down - My Controls" or "My User Event").
Please clarify...
At run time or when the VI is idle via scripting.
Can to provide a context where this is needed?
Ben
06-03-2019 09:42 AM
This is with VI Scripting. I would like to automatically create event cases in the structure based on the registered dynamic events, but I don't manage to get any information about what events are registered.
06-03-2019 09:50 AM
06-03-2019 09:53 AM
The problem is that works only if the event cases are already assigned manually to the events.
I would like to create all the cases programatically.
06-03-2019 10:19 AM - edited 06-03-2019 10:24 AM
@awilliotAcutronic wrote:
The problem is that works only if the event cases are already assigned manually to the events.
I would like to create all the cases programatically.
Huh?
You want to know at development time the event that are registered while the VI is running?
Please "throw us a bone" and clarify.
I suspect if Paul can not answer your question, "it can't be done".
See here were Ton showed us that dynamic event registration will let us register or re-register events dynamically at run time.
In the context of what he taught us, it is not possible to know ahead of time what will be registered.
Ben
06-03-2019 10:28 AM
No, the VIs are idle, this is for development only.
Some dynamic events are registered in a SubVI, common to a lot of structures. When these events are modified (by a developer), I want to run a script that will readjust all event structures.
For example I would like to create new event cases for all the newly registered events. So I need to detect what events are registered but are in no event case.
The optimal would be to have access to all the information that is shown in the Edit Events dialog box.
06-03-2019 10:45 AM
You can get the type descriptor for the event registration refnum and follow the LV help for flattened data and type descriptors to extract the names you are looking for.
Ignore the unused property (DynamicTerminalLeft) it was a copy/paste malfunction.
06-03-2019 10:50 AM
@awilliotAcutronic wrote:
No, the VIs are idle, this is for development only.
Some dynamic events are registered in a SubVI, common to a lot of structures. When these events are modified (by a developer), I want to run a script that will readjust all event structures.
For example I would like to create new event cases for all the newly registered events. So I need to detect what events are registered but are in no event case.
The optimal would be to have access to all the information that is shown in the Edit Events dialog box.
Hmmmm....
Show us your code please.
First issue is that registering for events in a sub-VI is a "not recommended" approach that has been discussed in a private forum that I can not link in public and many of the heavy hitters have expressed their displeasure with that condition and MAY be addressed way in the future.
Second is if you are registering for event sin a sub-VI and then branching the event registration wire... bad bad bad. I tis like forking a queue ref and using multiple dequeues... you can not predict which dequeue will get the new entries in a queue.
SO show us your code and we will do our best to guide you .... if possible.
Take care,
Ben
06-03-2019 11:16 AM
@Darin.K
That would be nice, but unfortunately the refnum TDs do not seem to be documented. I guess the Event Registration Refnum has its own TD implementation.
@Ben
- I have issues with the events being shifted when I add or remove events from the SubVI, I guess you refer to that problem. But I still prefer to keep the SubVI.
- No, the refnums are not branched. The events are registered exactly once per event structure.
- Here is an example code. The structures bundle events from a common SubVI and other events (the missing reference in the snippet is the Pane). I would like to be able to create all the event cases programatically based on the contents of the dynamic input. If a new event is added to the SubVI, I should be able to create a new case for it.