Axelwlt Posted June 3, 2019 Report Share Posted June 3, 2019 With VI Scripting, I can get the data type of an Event Registration Refnum as variant. How could I get the list of events (at least their names) that it contains? I need that to know what events are registered in an event structure, and at what indices, in order to manipulate the dynamic events in the structure with Scripting. Quote Link to comment
Popular Post Francois Normandin Posted June 4, 2019 Popular Post Report Share Posted June 4, 2019 (edited) You can extract the labels from the type descriptor, once you know where to find them in the array. I added support for it in this open source DataManipulation library. Check out the OpenDescriptor palette. You can install the latest release (1.1.0.5) from here: https://github.com/LabVIEW-Open-Source/DataManipulation/releases/tag/1.1.0.5 (download VIP file and install with VIPM). Once installed, you'll find the "List Element Names" method under Addons>DataManipulation>OpenDescriptor palette. (It can list enums and cluster elements as well, although those are natively supported under the Variant Utilities palette.) Edited June 4, 2019 by Francois Normandin changed a word. 5 Quote Link to comment
Axelwlt Posted June 5, 2019 Author Report Share Posted June 5, 2019 Thank you François, that's a nice library! Would it be possible to also get the event types from the TD (User Event/Mouse Up/...)? I don't find where this data is located in the TD. Ideally the event type should be a "vi.lib\event_ctls.llb\lveventtype.ctl" (so that it matches with the EventStructure:Get Handled Event method), but I don't know if the values match . In the enum, User Event is x41, but there is no x41 at all in the TD. Quote Link to comment
Francois Normandin Posted June 5, 2019 Report Share Posted June 5, 2019 They show up as Generic Refnums. (0x08) If they are named refnums, they should show up as in this example where "This VI" is the label. You can tell if they are named references by the 0x40 flag. If your events are named, they will show up in the list. The type of event is set in the last long byte in the "First Element" highlighted in green in the screenshot. (xA4 10) xA4 = VI reference, x10 = Key Down. I'll add this support to the OpenDescriptor. That is definitely useful info to get! I'll report here when done. 1 Quote Link to comment
Popular Post Francois Normandin Posted June 6, 2019 Popular Post Report Share Posted June 6, 2019 (edited) Version 1.2.0.6 released. https://github.com/LabVIEW-Open-Source/DataManipulation/releases/tag/1.2.0.6 Added support to return a list of Event reference types (class of event) for Event Registration Refnums Controls, Panes, Splitters, VI References and Application References. Array is empty for all other datatypes. ** Please note that this does not drill into clusters of Event Registration Refnums. This is only one-level deep. I have not tried, but I assume that getting the cluster elements and then looping on those should work... Edited June 6, 2019 by Francois Normandin added comment about cluster of event registrations. 2 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.