1 / 20

Event Queue – “unstructured” dynamic events

Event Queue – “unstructured” dynamic events. As presented by Jim Kring June 3 rd , 2003. Presentation Outline. Dynamic & User Events Object Model Dynamic Events API User Defined Events API OpenG Event Queue Added features Possibilities. Object Model – Dyn. & User Events.

Télécharger la présentation

Event Queue – “unstructured” dynamic events

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Event Queue –“unstructured” dynamic events As presented by Jim Kring June 3rd, 2003

  2. Presentation Outline • Dynamic & User Events Object Model • Dynamic Events API • User Defined Events API • OpenG Event Queue • Added features • Possibilities OpenG Group Meeting

  3. Object Model – Dyn. & User Events • Two new object Refnums in LabVIEW 7 • User Event Refnum (UER) • Event Registration Refnum (ERR) • Currently they are Un(der)documented • What are these objects? • How do they behave? • How do their API calls affect them? • As with many LabVIEW features, the documentation gives us “recommendations” for using them, but not the cold hard facts. OpenG Group Meeting

  4. Event Registration Refnum (ERR) VI Server Object Events and User Events may be “registered” with an Event Registration Object using a Register for Events node. OpenG Group Meeting

  5. Event Registration Refnum (ERR) • Points to an object that contains references to individual event queues – either VI Server Object or User Defined Event Queues. • When we “Register for Events”, we are creating a new (component) queue and telling an event source (object) to enqueue an event into that component queue. • When an Event Structure is passed an ERR it acts like a dequeue operation for all queues associated with the ERR. Dequeues in a round-robin fashion OpenG Group Meeting

  6. ERR – Strict Type Checking • Event Registration Refnums are strictly typed. Changing events will change type. Note - The only way to create an ERR control (or indicator) is to right-click  Create Control (or Indicator) Type Definition Custom Controls must be updated by opening .ctl file and replacing entire Refnum control. TypeChanged Added Event OpenG Group Meeting

  7. ERR –Type used by Event Structure • Event Registration Refnum’s type is used to constrain the edit-time choices for configuring cases of the Event Structure. OpenG Group Meeting

  8. 1 2 3 4 Register for Events nodes – 2 modes unwired wired Modes: • ERR input unwired (Create ERR & Registers for Events) • ERR input wired(Modify Event Registration) Bottom-Line: • The most upstream RFE node defines the type. • If the ERR input is wired, the RFE node becomes a slave to the input ERR type. OpenG Group Meeting

  9. User Events • A User Event is an event that the developer is allowed to generate. • As with VI Server Object Events, User Events are registered with an Event Registration Object and are dequeued by an Event Structure. OpenG Group Meeting

  10. Shortcomings of Dynamic Events • At edit-time, the developer must define the entire scope of event types that will be handled. • Strictness of ERR requires use of strict type-definitions which will permeate an architecture. Changes to type-def, which may be frequent, will cause changes to VIs containing an instance of the type-def. • Events (especially Filter Events) must be handled inside of an Event Structure. OpenG Group Meeting

  11. Shortcomings of Dynamic Events • The queue abstraction does not expose core properties, features, and behaviors of the registration and queue objects involved • Destroying ERR does not cause a waiting Event Structure (dequeue) to return • No Error I/O on Event Structure (dequeue) • No queue-like API (named queues, queue status, etc.) • No unique Create Event Registration function – functionality is bundled into Register for Events node OpenG Group Meeting

  12. Other Recommendations • Don’t wire an ERR into two Event Structures. The Event Structure does more than just dequeue events, it discards events that are not handled (“cased”) by an event structure. • Always register a user event with an ER so that you can kill an Event Structure programmatically. • Use ERR type definitions • If you get fancy, you might crash LabVIEW OpenG Group Meeting

  13. OpenG “Event Queue” – Goals The Goals of the Event Queue are to: • wrap dynamic events into a queue-like API tailored to the needs of advanced users, • generalize event data using a structure compatible with all event types, • and move event handling (especially Filter Events) out of the event structure, … so that flexible architectures and reuse tools may be built which employ dynamic event type introspection and handling. OpenG Group Meeting

  14. Event Queue API OpenG Group Meeting

  15. Event Data Cluster The Event Data Cluster is a Generic Data structure for storing event data from all classes of events OpenG Group Meeting

  16. Event Agents • When an event is registered, an agent (process) is spawned for dequeuing it’s the event using an Event Structure and enqueuing it into the Event Queue (a real LabVIEW queue) • Notify events only need one agent per class of event, but Filter events need one agent per VI Server Object. This is because Filter events are blocked until filter data is received. OpenG Group Meeting

  17. Notify Event Agent OpenG Group Meeting

  18. Filter Event Agent OpenG Group Meeting

  19. Example – Panel Closing? OpenG Group Meeting

  20. Recap • Dynamic typing in a Queue-like API provides more flexibility than strictly typed ERR and Event Structure • Great for reuse tools and application frameworks • OpenG Event Queue is still in the design phase OpenG Group Meeting

More Related