Register For Events
- Updated2025-03-14
- 4 minute(s) read
Dynamically 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.

Inputs/Outputs
![]() event registration refnum is a reference to an existing event registration a Register For Events function created. ![]() error in describes error conditions that occur before this node runs. This input provides standard error in functionality. ![]() event source 1..n is a reference to an application, VI, control, or user event. References must be to local objects. You cannot wire a reference to a remote object. If you wire an array or cluster of refnums to this input, LabVIEW registers all elements of the array or cluster for the event.![]() event reg refnum out returns the reference to a new or existing event registration. ![]() error out contains error information. This output provides standard error out functionality. |
When using dynamic registration, make sure you have a Register For Events function for each Event structure.
Each event source input is a reference to an application, VI, control, or user event. Each kind of event source can produce a variety of events. To specify which event you want LabVIEW to begin detecting for a particular event source, right-click the data item for the event source and select the event to detect. After this function executes, LabVIEW detects, or registers, every repetition of that event that occurs. LabVIEW stores these events in a queue so that an Event structure can handle the events later in the VI.
You can wire the event reg refnum out terminal of the Register For Events function to the dynamic event terminals on the Event structure border, to the Unregister For Events function, or to the top left input of another Register For Events function. If you wire the top left input of the Register For Events function, the function modifies the existing registration information associated with that refnum instead of registering the event again.
Registered events stay registered until you explicitly unregister them or until the VI that registered the events finishes running or you abort the VI. If the VI which registered for events was a subVI, events are unregistered when that VI's top-level VI finishes execution or is aborted. If you use the Run VI method to execute a subVI that registered for events, events are unregistered when the subVI finishes execution or is aborted.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Dialog and User Interface\Events\Dynamic Event Generation.vi