Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Create User Event (Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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  Examples

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.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
user event out returns the strictly typed user event refnum.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

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 instances, 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.

Examples

Refer to the following VIs for examples of using the Create User Event function:

  • Programmatically Fire Events VI: labview\examples\general\dynamicevents.llb
  • Dynamically Monitor VI's VI: labview\examples\general\dynamicevents.llb

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit