Data Acquisition Toolbox | ![]() ![]() |
Timer Events
The only event supported by DIO objects is a timer event. Timer events occur after a specified period of time has passed. Properties associated with generating timer events are given below.
Property Name |
Description |
Running |
Indicate if the device object is running. |
TimerFcn |
Specify the M-file callback function to execute whenever a predefined period of time passes. |
TimerPeriod |
Specify the period of time between timer events. |
A timer event is generated whenever the time specified by TimerPeriod
passes. This event executes the callback function specified for TimerFcn
. Time is measured relative to when the device object starts running (Running
is On
). Starting a DIO object is discussed in the next section.
Some timer events might not be processed if your system is significantly slowed or if the TimerPeriod
value is too small. For example, a common application for timer events is to display data. However, because displaying data can be a CPU-intensive task, some of these events might be dropped. For digital I/O objects, timer events are typically used to display the state of the object.
To see how to construct a callback function, refer to Creating and Executing Callback Functions or the example below.
![]() | Generating Timer Events | Starting and Stopping a Digital I/O Object | ![]() |