EventLog

Store information for specific events

Description

Eventlog is a structure array that stores information related to specific analog input (AI) or analog output (AO) events. Event information is stored in the Type and Data fields of EventLog. Type stores the event type. The logged event types are shown below.

Event Type

Description

AI

AO

Data missed

Data is missed by the engine.

 

Input overrange

A signal exceeds the hardware input range.

 

Run-time error

A run-time error is encountered. Run-time errors include timeouts and hardware errors.

Start

The start function is issued.

Stop

The device object stops executing.

Trigger

A trigger executes.

Timer events, samples available events (AI), and samples output events (AO) are not logged.

Data stores event-specific information associated with the event type in several fields. For all stored events, Data contains the RelSample field, which returns the input or output sample number at the time the event occurred. For the start, stop, run-time error, and trigger events, Data contains the AbsTime field, which returns the absolute time (as a clock vector) the event occurred. Other event-specific fields are included in Data. For a description of these fields, refer to Events and Callbacks for analog input objects and analog output objects, or the appropriate reference pages in this chapter.

EventLog can store a maximum of 1000 events. If this value is exceeded, then the most recent 1000 events are stored. You can use the showdaqevents function to easily display stored event information.

Characteristics

Usage

AI, AO, common to all channels

Access

Read-only

Data type

Structure array

Read-only when running

N/A

Values

Values are automatically added as events occur. The default value is an empty structure array.

Examples

Create the analog input object ai and add four channels to it.

ai = analoginput('nidaq','Dev1');
chans = addchannel(ai,0:3);

Acquire 1 second of data and display the logged event types.

start(ai)
events = ai.EventLog;
{events.Type}
ans = 
    'Start'    'Trigger'    'Stop

To examine the data associated with the trigger event:

events(2).Data
ans = 
      AbsTime: [1999 2 12 14 54 52.5456]
    RelSample: 0
      Channel: []
      Trigger: 1

See Also

Functions

showdaqevents

Was this topic helpful?