TimerFcn - Specify M-file callback function to execute when predefined time period passes

Description

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).

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.

Characteristics

Usage

AI, AO, DIO, common to all channels and lines

Access

Read/write

Data type

String

Read-only when running

No

Values

The default value is an empty string.

See Also

Properties

EventLog, SamplesAcquiredFcn, SamplesOutputFcn, TimerPeriod

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS