11-06-2018 04:14 AM
Hello,
can I read the sequence # in the event structure? I mean, I'd like to understand the sw flow during the run time and I need the sequence#, at the moment I'm doing it by myself. Please see the attached VI.
Thank you,
Fabio
11-06-2018 10:27 AM
First, you should have started a new thread for your question. It has nothing to do with the original topic. Secondly, use a shift register for your sequence number. Then you can access it in any case of the event structure. It will need to be wired through all event cases.
02-27-2024 11:41 AM
@Intaris wrote:
I have just tested it and it is indeed exactly as mentioned, an Event structure deletes all registered events which it is not told to handle.
I know this is an old thread, but I just ran into it when researching a specific aspect of the topic, and for the sake of posterity, I wanna clarify (or maybe just say in my own words?).
Regarding programmatically registered events - both user events and UI events:
The last point led to a nasty memory leak in one of our customers' application, where the event structure was stalled in one case, which led to unhandled events not being discarded, which led to a crash eventually.
Also, since the last comment here, a new source for learning is available: Olivier's great presentation about "10 things to know (or more) about events in LabVIEW"
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
02-28-2024 07:17 AM
The status of being handled or unhandled by the event structure here is a bit of a red herring.
This would result in RAM consumption independent of whether the events are handled or not, no?
02-28-2024 08:52 AM - edited 02-28-2024 08:52 AM
@Intaris wrote:
The status of being handled or unhandled by the event structure here is a bit of a red herring.
This would result in RAM consumption independent of whether the events are handled or not, no?
I agree, yes. Here's my understanding:
Reading it back, it makes sense. I don't think I've ever thought about this (and picked my words) so diligently 🙂
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )
02-28-2024 09:13 AM
@joerg.hampel wrote:
Reading it back, it makes sense. I don't think I've ever thought about this (and picked my words) so diligently 🙂
Understanding precisely how Event Structures and Events in general work has been a real revelation to me. Jack Dunaway's post from years ago opened my eyes to how it actually functions "behind the scenes".
Events which have been registered (either statically within an ES or dynamically via "Register for events" node) are "deallocated" when they are handled or the "Event Registration Refnum" of the associated event registration is destroyed.
An event which is "next" in the execution queue of an Event structure (ES maintains order of execution of events across multiple different events) will be deallocated whether it is handled or not..
This changed in LV 2013 IIRC. Up until then, the memory leak was present even if the ES didn't hang. The events would be queued up and never handled, and thus never deallocated.