Create User Event Function
- Updated2025-07-30
- 3 minute(s) read
Returns 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.

Inputs/Outputs
user event data type
—
user event data type is a cluster of elements or an individual element whose data type and label define the data type and name of the user event. Note LabVIEW uses owned labels to identify data the user event carries, so label each element of the input with a descriptive owned label. If you do not add a label, the user event will not appear in the Event Data Node of an Event structure when added.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
user event out
—
user event out returns the strictly typed user event refnum.
error out
—
error out contains error information. This output provides standard error out functionality. |
The user event data type is a cluster of elements or an individual element. If you wire a cluster to the user event data type input, LabVIEW uses the type name of the cluster as the name of the user event. The names and data types of the cluster elements define the event data the user event carries. If you wire an individual data element to the user event data type input, LabVIEW uses the type name of the element as the name of the user event and as the name of the single data item it carries, which is the same data type as the element. The actual value you wire to the function is not important because LabVIEW uses only the name and data type to define the user event. The user event out output is a strictly typed refnum that includes the user event name and event data type.
You can wire the user event out output to the Generate User Event function and the Destroy User Event function. Wire the user event out output to the Register For Events function to dynamically register for notification when the user event occurs. When you handle a user event in an Event structure, the name of the user event appears in the event selector label at the top of the Event structure, and the user event data fields appear in the Event Data Node inside the left border of the event case.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Dialog and User Interface\Events\User Event Generation.vi
user event data type
—
error in (no error)
—
user event out
—
error out
—