Table Of Contents

Software Events

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:

Every N Samples Acquired Into Buffer Event—Occurs when the user-defined number of samples is written from the device to the PC buffer. This event works only with devices that support buffered tasks.

Note

Some devices—such as AO Series, E Series, and M Series devices—require that the sample interval divide evenly into the buffer size when using DMA as your data transfer mechanism. For instance, if the buffer size is 1,000 samples, specifying 102 for this software event generates an error. Specifying 100, however, would not generate an error. If you are using IRQ as the data transfer method, the value does not need to be evenly divisible. With IRQ, however, the Data Transfer Request Condition attribute/property can affect when this software event occurs.

Every N Samples Transferred From Buffer Event—Occurs when the user-defined number of samples is written from the PC buffer to the device. This event works only with devices that support buffered tasks.

Note

Some devices—such as AO Series, E Series, and M Series devices—require that the sample interval divide evenly into the buffer size when using DMA as your data transfer mechanism. For instance, if the buffer size is 1,000 samples, specifying 102 for this software event generates an error. Specifying 100, however, would not generate an error. If you are using IRQ as the data transfer method, the value does not need to be evenly divisible. With IRQ, however, the Data Transfer Request Condition attribute/property can affect when this software event occurs.

Done Event—Occurs when the task completes execution or when an error causes the task to finish. Recoverable errors that do not cause the task to finish do not cause this event to fire. Calling the Stop Task function/VI to complete execution similarly does not cause this event to fire.