Owning Palette: Events Functions
Requires: Full Development System
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.
|event registration refnum is a reference to an existing event registration a Register For Events function created.|
|error in (no error) 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.|
Each event source input is a reference to an application, VI, control, or user event. You can right-click each data item and select which event to register for that event source. 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.
|Note LabVIEW does not include an event registration refnum on the Controls palette because the event registration refnum is strictly typed and a generic version does not exist. You can create an event registration refnum by configuring a Register For Events function or right-clicking the function and creating a control or indicator from the shortcut menu. You also can select the part of the application that includes the event registration refnum and selecting Edit»Create SubVI to create a subVI from the selection. If you later modify the Register For Events function and change the type of the event registration refnum, you must recreate the control or indicator to match.|
Refer to the following VIs for examples of using the Register For Events function: