Creating Custom Events
- Updated2025-08-15
- 5 minute(s) read
You can create and name custom events, called user events, to carry data that you define. User events allow different parts of an application to communicate asynchronously. Unlike user interface events, which require direct user interaction with front panel objects, user events allow you to create an application that responds to programmatic changes on objects. You can handle both user interface events and programmatically generated user events in the same Event structure.
What to Use
—Create User Event
—Register For Events
—Event Structure
— Generate User Event
— Unregister For Events
—Destroy User EventWhat to Do
Create the following block diagram to build a user event that programmatically carries data you define.

The following list describes important details about the previous diagram.
Caveats and Recommendations
- You cannot register for a user event statically.
- You can register for the same user event multiple times by using separate Register For Event functions. In this situation, each queue associated with an event registration refnum receives a copy of the user event and associated event data each time the Generate User Event function executes.
- User events are notify events and can share the same event case of an Event structure as user interface events or other user events.
- To simulate user interaction with a front panel, you can create a user event that has event data items with the same names and data types as an existing user interface event. For example, you can create a user event called MyValChg by using a cluster of two Boolean fields named OldVal and NewVal, which are the same event data items the Value Change user interface event associates with a Boolean control. You can share the same Event structure case for the simulated MyValChg user event and a real Boolean Value Change event. The Event structure executes the event case if a Generate User Event function generates the user event or if a user changes the value of the control.
Examples
Refer to the labview\examples\Dialog and User Interface\Events\Events.lvproj for examples of dynamically registering events.
Refer to the User Event Generation VI in the labview\examples\Dialog and User Interface\Events directory for an example of using user events.