Software Events

NI-DAQmx Key Concepts

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  The value you set for this event must be evenly divisible into the buffer size if you are 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  The value you set for this event must be evenly divisible into the buffer size if you are 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.