Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Events Functions

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Owning Palette: Dialog & User Interface VIs and Functions

Requires: Base Development System. This topic might not match its corresponding palette in LabVIEW depending on your operating system, licensed product(s), and target.

Use the Events functions to register events dynamically and to create user events.

Examples

Palette ObjectDescription
Create User EventReturns a reference to a user event. LabVIEW uses the user event data type you wire to determine the event name and data type of the event. Wire the user event out output to a Register For Events function to register for the event. Wire the user event out output to a Generate User Event function to send the event and associated data to all Event structures registered for the event.
Destroy User EventReleases a user event reference by destroying its associated user event refnum. Any Event structures registered for this user event no longer receive the event.
Event StructureWaits until an event occurs, then executes the appropriate case to handle that event. The Event structure has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes to handle an event. This structure can time out while waiting for notification of an event. Wire a value to the Timeout terminal at the top left of the Event structure to specify the number of milliseconds the Event structure waits for an event. The default is -1, which indicates never to time out.
Flush Event QueueDiscards the least recent notify events from one or more event queues. If the event queue that you want to discard includes filter events, this function stops at the first filter event in the queue and discards only the events that occurred previous to the stop.
Generate User EventBroadcasts the user event you wire to the user event input and sends the user event and associated event data to each Event structure registered to handle the event.
Register For EventsDynamically registers events. The events for which you can register depend on the type of the reference you wire to each event source input. Wire the event reg refnum out output to an Event structure or to another Register For Events function.
Unregister For EventsUnregisters all events associated with an event registration refnum.

Examples

Refer to the following VIs for examples of using the Events Functions:

  • labview\examples\Dialog and User Interface\Events\Events.lvproj
  • labview\examples\Structures\Event Structure\Event Structure.lvproj

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit