| Data Acquisition Toolbox | Search  Help Desk |
| EventLog | Examples |
Eventlog is a structure array that stores certain event information in the Type and Data fields.
The Type field stores the event type. For analog input objects, the logged event types are start, stop, trigger, runtime error, input over-range, and data missed events. For analog output objects, the logged event types are start, stop, trigger, runtime error, and out-of-data events. Timer events, data-available events (AI), and data-output events (AO) are not logged.
The Data field stores event-specific information associated with the event type in several subfields. For all stored events, Data contains the TimeStamp and SampleStamp subfields. TimeStamp contains the absolute time the event occurred and SampleStamp contains the number of samples processed by the data acquisition engine at the time the event occurred. Other event-specific subfields are included in Data. For a description of these subfields, refer to "Configuring Events and Actions".
EventLog can store a maximum of 1024 events.
Characteristics
| Device Objects | AI, AO |
| Class | Common |
| Access | Read-only |
| Data Type | Structure array |
| Modify while Running | N/A |
Values
The default value is an empty structure arrayExample
Suppose you perform the following one-second acquisition for a National Instruments board.ai = analoginput('nidaq', 1);
chans = addchannel(ai, 0:3);
set(ai,'SampleRate', 1000);
ActualRate = get(ai,'SampleRate')
duration = 1; % One second acquisition
set(ai,'SamplesPerTrigger', ActualRate*duration)
start(ai)
data=getdata(ai);
You can examine the logged event types
events = ai.EventLog events.Typeand the data associated with the events
events.Data