| Data Acquisition Toolbox™ | ![]() |
A timer event is generated whenever the time specified by the TimerPeriod property passes. This event executes the callback function specified for TimerFcn. 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. For example, displaying data, which is a common application for timer events can be dropped as it is a CPU-intensive task. A timer event can be dropped if there is a newer event in the queue. To guarantee that events are not dropped, you should use the SamplesAcquiredFcn property (analog input) or the SamplesOutputFcn property (analog output).
Note Use the SamplesAvailable property to see the number of samples in the queue before you execute the timer event. |
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 EventLog property. 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 Data field value is given below.
Data Field Value | Description |
|---|---|
AbsTime | The absolute time (as a clock vector) the event occurred. |
Usage | AI, AO, DIO, common to all channels and lines |
Access | Read/write |
Data type | String |
Read-only when running | No |
The default value is an empty string.
EventLog, SamplesAcquiredFcn, SamplesOutputFcn, TimerPeriod
![]() | Timeout | TimerPeriod | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |