Create User Event Function

Owning Palette: Events Functions

Requires: Base Development System

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.

Details  Example

 Add to the block diagram  Find on the palette
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 describes error conditions that occur before this node runs. This input provides standard error in functionality.
user event out returns the strictly typed user event refnum.
error out contains error information. This output provides standard error out functionality.

Create User Event Details

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.

Note  If you obtain a user event reference in one application instance, you cannot use that user event reference in another application instance. If you attempt to use a user event reference in another application instance, LabVIEW returns error 1500.

Example

Refer to the User Event Generation VI in the labview\examples\Dialog and User Interface\Events directory for an example of using the Create User Event function.

 Open example  Find related examples