DataAvailable
(Not recommended) Notify when acquired data is available to process
This session object function is not recommended. Use DataAcquisition
object functions instead. See Version History.
Syntax
Description
lh = addlistener(
creates a listener for the session,'DataAvailable',callbackfct);DataAvailable event. When data is
available to process, the callback executes. The callback can be any MATLAB® function with the (src,event) signature.
Tip
The frequency with which the DataAvailable event
is fired, is controlled by NotifyWhenDataAvailableExceeds
lh = addlistener(
creates a listener for the session,'DataAvailable',@(src,event)
expr)DataAvailable event and fires an
anonymous callback function. The anonymous function requires the specified input
arguments and executes the operation specified in the expression
expr. Anonymous functions provide a quick means of
creating simple functions without storing your function in a separate file. For
more information see Anonymous
Functions.
The callback has two required parameters: src and
event. src is the session object for
the listener and event is a
daq.DataAvailableInfo object containing the data
associated and timing information. Properties of
daq.DataAvailableInfo are:
- Data
An
m-by-nmatrix of doubles wheremis the number of scans acquired, andnis the number of input channels in the session.- TimeStamps
The timestamps relative to
TriggerTimein anm-by-1 array wheremis the number of scans acquired.- TriggerTime
A MATLAB serial date time stamp representing the absolute time the acquisition trigger occurs.