NI-DAQmx Events in LabVIEW provide a way of generating a signal from the hardware or a software interrupt when certain conditions are met on the data acquisition hardware. The main advantage of using NI-DAQmx events is that it is not processor intensive and does not block access to any other driver call to a DAQ device since NI-DAQmx is multithreaded.
NI-DAQmx Events can be used for PC buffer monitoring and can be used in conjunction with DMA data transfer. However, they are not used for transferring data across the PCI bus.
NI-DAQmx Events can be generated both at hardware and software level.
Generally, triggers and clocks are input signals but exportable triggers and clocks, such as the sample clock, also can be output signals. Output signals that do not have a trigger or clock counterpart are called hardware events. Events are generated to signify a device state change, the arrival of a certain kind of sample, the production of a certain amount of samples, or the passage of time.
NI-DAQmx includes the following hardware events:
To set these events in LabVIEW use the DAQmx Export Signal Property Node. This is located in LabVIEW under Measurement I/O >>DAQmx-Data acquisition >> DAQmx Advanced Task Options >> DAQmx Export Signal as shown in Figure 1.
Figure 1. DAQmx Export Signal Property Node
With the DAQmx Export Signal Property Node, you can select the Event polymorphic instance such as AI Hold Complete Events, Change Detection Events, Counter Output Events as shown in Figure 2.
Figure 2 Counter output event properties
Others are located in in LabVIEW under Measurement I/O >>DAQmx-Data acquisition >> DAQmx Advanced Task Options sub-palette and in LabVIEW under Measurement I/O >>DAQmx-Data acquisition >> DAQmx Device Configuration >> watchdog sub-palette.
Software events provide an asynchronous notification mechanism for a set of DAQ events. Unlike hardware events, software events do not require you to use a thread to wait until data is available. Using event-based programming, you can write an application that continues to perform work while waiting for data without resorting to developing a multi-threaded application.
NI-DAQmx includes the following software events:
Figure 3 is a block diagram for an event-response application. Programmatically, the event, in this instance, is a rising edge on a digital line, PFI0. The response is the execution of the Timed Loop structure, which sets a digital line, line0. To create a real-time event response application with the Timed Loop and a DAQ device, you need to use the Create Timing Source VI.
Figure 3. Creating Events with Timing Source VI.