| Data Acquisition Toolbox | ![]() |
An action function that displays event information for the specified event
Syntax
daqaction(obj,event)
Arguments
obj |
A device object. |
event |
A variable that captures the event information contained by the EventLog property. |
Description
is an example action function that displays information to the MATLAB command window. For all events, the information includes the event type and the name of the device object that caused the event to occur. For events that record the absolute time in daqaction(obj,event)
EventLog, the event time is also displayed. For run-time error events, the error message is also displayed.
Remarks
You specify daqaction as the action function to be executed for any event by specifying it as the value for the associated action property. For analog input objects, daqaction is the default value for the DataMissedAction and RuntimeErrorAction properties. For analog output objects, daqaction is the default value for the RuntimeErrorAction property.
You can use the showdaqevents function to easily display event information captured by the EventLog property.
Example
Create the analog input object ai and call the action function daqaction when a trigger event occurs.
ai = analoginput('winsound');
addchannel(ai,1);
set(ai,'TriggerRepeat',3)
set(ai,'TriggerAction','daqaction')
start(ai)
Functions
Properties
DataMissedAction, EventLog, RuntimeErrorAction
| clear | daqfind | ![]() |