Data Acquisition Toolbox    

Example: Generating Timer Events

This example illustrates how to generate timer events for a digital I/O object. The action function daqaction displays the event type and device object name. Note that you must issue a stop command to stop the execution of the digital I/O object.

You can run this example by typing daqdoc7_2 at the MATLAB command line.

1. Create a device object - Create the digital I/O object dio for a National Instruments board. The installed adaptors and hardware IDs are found with daqhwinfo.

2. Add lines - Add eight input lines from port 0 (line-configurable).

3. Configure property values - Configure the timer event to call daqaction every five seconds.

Start the digital I/O object. You must issue a stop command when you no longer want to generate timer events.

4. Clean up - When you no longer need dio, you should remove it from memory and from the MATLAB workspace.


 Starting and Stopping a Digital I/O Object Evaluating the Digital I/O Object Status