Data Acquisition Toolbox | ![]() ![]() |
Timer Events
The only event supported by digital I/O 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 |
Indicates if the device object is running. |
TimerAction |
Specifies the M-file action function to execute whenever a predefined period of time passes. |
TimerPeriod |
Specifies the period of time between timer events. |
A timer event is generated whenever the time specified by TimerPeriod
passes. This event executes the action function specified for TimerAction
. Time is measured relative to when the device object starts running (Running
is On
). Starting a digital I/O object is discussed in the next section.
Some timer events may 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, since displaying data can be a CPU-intensive task, some of these events may be dropped. For digital I/O objects, timer events are typically used to display the state of the device object. Refer to the diopanel
demo for an example that generates timer events to update the state of a digital I/O object.
To see how to construct an action function, refer to Creating and Executing Action Functions or the example below.
![]() | Generating Timer Events | Starting and Stopping a Digital I/O Object | ![]() |