Specify callback function to execute when predefined time period passes
Note: You cannot use the legacy interface on 64-bit MATLAB®. See About the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
A timer event is generated whenever the time specified by the
passes. This event executes the callback function specified for
Time is measured relative to when the device object starts running.
Some timer events might not be processed if your system is significantly
slow or if the
TimerPeriod value is too small.
The time taken to process an event depends on the sample rate, the
performance of your system, and the data itself.
There can only be one timer event waiting in the queue at a
given time. The callback function must process all available data
to ensure that it keeps up with the inflow of data. Alternatively,
you can use the
SamplesAcquiredFcn (analog input)
SamplesOutputFcn (analog output) property to
process the data when a specified number of samples is acquired or
For analog input objects, use the
For digital I/O objects, timer events are typically used to update and display the state of the device object.
Timer event information is not stored in the
When the callback function is executed, the second argument is a structure
containing two fields. The
Type field value is
set to the string
'Timer', and the event
value is given below.
Data Field Value
The absolute time (as a
AI, AO, DIO, common to all channels and lines
Read-only when running
The default value is an empty string.