Data Acquisition Toolbox    

Event Types

The analog input event types and associated action properties are described below.

Table 5-11: Analog Input Action Properties  
Event Type
Property Name
Data missed
DataMissedAction
Input overrange
InputOverRangeAction
Run-time error
RuntimeErrorAction
Samples acquired
SamplesAcquiredAction
SamplesAcquiredActionCount
Start
StartAction
Stop
StopAction
Timer
TimerAction
TimerPeriod
Trigger
TriggerAction

Data Missed Event.   A data missed event is generated immediately after acquired data is missed. In most cases, data is missed because:

This event executes the action function specified for the DataMissedAction property. The default value for DataMissedAction is daqaction, which displays the event type and the device object name. When a data missed event occurs, the analog input object is automatically stopped.

Input Overrange Event.   An input overrange event is generated immediately after an overrange condition is detected for any channel group member. An overrange condition occurs when an input signal exceeds the range specified by the InputRange property.

This event executes the action function specified for the InputOverRangeAction property. Overrange detection is enabled only when an action function is specified for InputOverRangeAction, and the analog input object is running.

Run-time Error Event.   A run-time error event is generated immediately after a run-time error occurs. Additionally, a toolbox error message is automatically displayed to the MATLAB workspace. If an error occurs that is not explicitly handled by the toolbox, then the hardware-specific error message is displayed.

This event executes the action function specified for RuntimeErrorAction. The default value for RuntimeErrorAction is daqaction, which displays the event type, the time the event occurred, the device object name, and the error message.

Run-time errors include hardware errors and timeouts. Run-time errors do not include configuration errors such as setting an invalid property value.

Samples Acquired Event.   A samples acquired event is generated immediately after a predetermined number of samples is acquired.

This event executes the action function specified for the SamplesAcquiredAction property every time the number of samples specified by SamplesAcquiredActionCount is acquired for each channel group member.

You should use SamplesAcquiredAction if you must access each sample that is acquired. However, if you are performing a CPU-intensive task with the data, then system performance may be adversely affected. If you do not have this requirement, you may want to use the TimerAction property.

Start Event.   A start event is generated immediately after the start function is issued. This event executes the action function specified for StartAction. When the StartAction M-file has finished executing, Running is automatically set to On and the device object and hardware device begin executing.

Stop Event.   A stop event is generated immediately after the device object and hardware device stop running. This occurs when:

A stop event executes the action function specified for StopAction. Under most circumstances, the action function is not guaranteed to complete execution until sometime after the device object and hardware device stop running, and the Running property is set to Off.

Timer Event.   A timer event is generated whenever the time specified by the TimerPeriod property passes. This event executes the action function specified for TimerAction. Time is measured relative to when the device object starts running.

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 is a CPU-intensive task, some of these events may be dropped. To guarantee that events are not dropped, use the SamplesAcquiredAction property.

Trigger Event.   A trigger event is generated immediately after a trigger occurs. This event executes the action function specified for the TriggerAction property. Under most circumstances, the action function is not guaranteed to complete execution until sometime after Logging is set to On.


 Configuring Events and Actions Recording and Retrieving Event Information